diff options
Diffstat (limited to 'tests/admin_scripts')
| -rw-r--r-- | tests/admin_scripts/management/commands/app_command.py | 4 | ||||
| -rw-r--r-- | tests/admin_scripts/tests.py | 17 |
2 files changed, 9 insertions, 12 deletions
diff --git a/tests/admin_scripts/management/commands/app_command.py b/tests/admin_scripts/management/commands/app_command.py index 5cbddb6e96..5f221f48ee 100644 --- a/tests/admin_scripts/management/commands/app_command.py +++ b/tests/admin_scripts/management/commands/app_command.py @@ -6,5 +6,5 @@ class Command(AppCommand): requires_model_validation = False args = '[appname ...]' - def handle_app(self, app, **options): - print('EXECUTE:AppCommand app=%s, options=%s' % (app, sorted(options.items()))) + def handle_app_config(self, app_config, **options): + print('EXECUTE:AppCommand name=%s, options=%s' % (app_config.name, sorted(options.items()))) diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 3f9a336c16..cc0531a124 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -1416,27 +1416,24 @@ class CommandTypes(AdminScriptTestCase): args = ['app_command', 'auth'] out, err = self.run_manage(args) self.assertNoOutput(err) - self.assertOutput(out, "EXECUTE:AppCommand app=<module 'django.contrib.auth.models'") - self.assertOutput(out, "module 'django.contrib.auth.models' from") - self.assertOutput(out, str_prefix("'>, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity', %(_)s'1')]")) + self.assertOutput(out, "EXECUTE:AppCommand name=django.contrib.auth, options=") + self.assertOutput(out, str_prefix(", options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity', %(_)s'1')]")) def test_app_command_no_apps(self): "User AppCommands raise an error when no app name is provided" args = ['app_command'] out, err = self.run_manage(args) - self.assertOutput(err, 'Error: Enter at least one appname.') + self.assertOutput(err, 'Error: Enter at least one application label.') def test_app_command_multiple_apps(self): "User AppCommands raise an error when multiple app names are provided" args = ['app_command', 'auth', 'contenttypes'] out, err = self.run_manage(args) self.assertNoOutput(err) - self.assertOutput(out, "EXECUTE:AppCommand app=<module 'django.contrib.auth.models'") - self.assertOutput(out, "module 'django.contrib.auth.models' from") - self.assertOutput(out, str_prefix("'>, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity', %(_)s'1')]")) - self.assertOutput(out, "EXECUTE:AppCommand app=<module 'django.contrib.contenttypes.models'") - self.assertOutput(out, "module 'django.contrib.contenttypes.models' from") - self.assertOutput(out, str_prefix("'>, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity', %(_)s'1')]")) + self.assertOutput(out, "EXECUTE:AppCommand name=django.contrib.auth, options=") + self.assertOutput(out, str_prefix(", options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity', %(_)s'1')]")) + self.assertOutput(out, "EXECUTE:AppCommand name=django.contrib.contenttypes, options=") + self.assertOutput(out, str_prefix(", options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity', %(_)s'1')]")) def test_app_command_invalid_appname(self): "User AppCommands can execute when a single app name is provided" |
