Add support for the --reverse test parameter.
This commit is contained in:
@@ -15,6 +15,11 @@ class Command(management.BaseCommand):
|
||||
default=False,
|
||||
help='Don\'t use migrations when creating the test database.'
|
||||
),
|
||||
make_option(
|
||||
'--reverse', action='store_true', dest='reverse',
|
||||
default=False,
|
||||
help='Reverses test cases order.'
|
||||
),
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
@@ -22,6 +27,9 @@ class Command(management.BaseCommand):
|
||||
if options.get('nomigrations'):
|
||||
kwargs['nomigrations'] = True
|
||||
|
||||
if options.get('reverse'):
|
||||
kwargs['reverse'] = True
|
||||
|
||||
test_apps = [app.name for app in apps.apps.get_app_configs() if getattr(app, 'test', False)]
|
||||
|
||||
print 'Testing: {}'.format(', '.join(test_apps))
|
||||
|
||||
Reference in New Issue
Block a user