mirror of
https://github.com/django/django.git
synced 2025-08-30 23:37:50 +00:00
Fixed #25285 -- Provided unknown command message with plain django-admin.py
Thanks Maxime Lorant for the report and Tim Graham for suggesting the improved comment.
This commit is contained in:
parent
f9de197268
commit
c1893e2839
2 changed files with 20 additions and 8 deletions
|
@ -283,7 +283,8 @@ class DjangoAdminDefaultSettings(AdminScriptTestCase):
|
|||
args = ['noargs_command']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertNoOutput(out)
|
||||
self.assertOutput(err, "settings are not configured")
|
||||
self.assertOutput(err, "No Django settings specified")
|
||||
self.assertOutput(err, "Unknown command: 'noargs_command'")
|
||||
|
||||
def test_custom_command_with_settings(self):
|
||||
"default: django-admin can execute user commands if settings are provided as argument"
|
||||
|
@ -351,7 +352,8 @@ class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase):
|
|||
args = ['noargs_command']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertNoOutput(out)
|
||||
self.assertOutput(err, "settings are not configured")
|
||||
self.assertOutput(err, "No Django settings specified")
|
||||
self.assertOutput(err, "Unknown command: 'noargs_command'")
|
||||
|
||||
def test_custom_command_with_settings(self):
|
||||
"fulldefault: django-admin can execute user commands if settings are provided as argument"
|
||||
|
@ -418,7 +420,8 @@ class DjangoAdminMinimalSettings(AdminScriptTestCase):
|
|||
args = ['noargs_command']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertNoOutput(out)
|
||||
self.assertOutput(err, "settings are not configured")
|
||||
self.assertOutput(err, "No Django settings specified")
|
||||
self.assertOutput(err, "Unknown command: 'noargs_command'")
|
||||
|
||||
def test_custom_command_with_settings(self):
|
||||
"minimal: django-admin can't execute user commands, even if settings are provided as argument"
|
||||
|
@ -485,7 +488,8 @@ class DjangoAdminAlternateSettings(AdminScriptTestCase):
|
|||
args = ['noargs_command']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertNoOutput(out)
|
||||
self.assertOutput(err, "settings are not configured")
|
||||
self.assertOutput(err, "No Django settings specified")
|
||||
self.assertOutput(err, "Unknown command: 'noargs_command'")
|
||||
|
||||
def test_custom_command_with_settings(self):
|
||||
"alternate: django-admin can execute user commands if settings are provided as argument"
|
||||
|
@ -555,7 +559,8 @@ class DjangoAdminMultipleSettings(AdminScriptTestCase):
|
|||
args = ['noargs_command']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertNoOutput(out)
|
||||
self.assertOutput(err, "settings are not configured")
|
||||
self.assertOutput(err, "No Django settings specified")
|
||||
self.assertOutput(err, "Unknown command: 'noargs_command'")
|
||||
|
||||
def test_custom_command_with_settings(self):
|
||||
"alternate: django-admin can execute user commands if settings are provided as argument"
|
||||
|
@ -644,7 +649,8 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase):
|
|||
args = ['noargs_command']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertNoOutput(out)
|
||||
self.assertOutput(err, "settings are not configured")
|
||||
self.assertOutput(err, "No Django settings specified")
|
||||
self.assertOutput(err, "Unknown command: 'noargs_command'")
|
||||
|
||||
def test_builtin_with_settings(self):
|
||||
"directory: django-admin builtin commands succeed if settings are provided as argument"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue