import os

os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

from django.core import management

apps = [
    'test',
    'core',
    'exporting',
    'formatters',
    'lexicon',
    'events',
    'history',
    'models',
    'query',
    'sets',
    'stats',
    'search',
    'subcommands',
    'validation',
]

management.call_command(*apps)

import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

from django.core import management

apps = sys.argv[1:]

if not apps:
    apps = [
        'core',
        'exporting',
        'formatters',
        'lexicon',
        'events',
        'history',
        'models',
        'query',
        'sets',
        'stats',
        'search',
        'subcommands',
        'validation',
    ]

management.call_command('test', *apps)

Allow apps to be specified from the command line
Allow apps to be specified from the command line

  import os
+ import sys
  
  os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
  
  from django.core import management
  
+ apps = sys.argv[1:]
- apps = [
-     'test',
-     'core',
-     'exporting',
-     'formatters',
-     'lexicon',
-     'events',
-     'history',
-     'models',
-     'query',
-     'sets',
-     'stats',
-     'search',
-     'subcommands',
-     'validation',
- ]
  
- management.call_command(*apps)
+ if not apps:
+     apps = [
+         'core',
+         'exporting',
+         'formatters',
+         'lexicon',
+         'events',
+         'history',
+         'models',
+         'query',
+         'sets',
+         'stats',
+         'search',
+         'subcommands',
+         'validation',
+     ]
  
+ management.call_command('test', *apps)
+ 
Allow apps to be specified from the command line
## Code Before:
import os

os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

from django.core import management

apps = [
    'test',
    'core',
    'exporting',
    'formatters',
    'lexicon',
    'events',
    'history',
    'models',
    'query',
    'sets',
    'stats',
    'search',
    'subcommands',
    'validation',
]

management.call_command(*apps)

## Instruction:
Allow apps to be specified from the command line
## Code After:
import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

from django.core import management

apps = sys.argv[1:]

if not apps:
    apps = [
        'core',
        'exporting',
        'formatters',
        'lexicon',
        'events',
        'history',
        'models',
        'query',
        'sets',
        'stats',
        'search',
        'subcommands',
        'validation',
    ]

management.call_command('test', *apps)
