Add support for the --reverse test parameter.

This commit is contained in:
Roberto Rosario
2016-11-14 02:34:56 -04:00
parent a5a6afe240
commit a335f39e2a

View File

@@ -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))