mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #28398 -- Added suggestions for mistyped management commands.
This commit is contained in:
parent
f7b46f0b58
commit
33ac036a6b
2 changed files with 26 additions and 4 deletions
|
@ -2256,3 +2256,23 @@ class MainModule(AdminScriptTestCase):
|
|||
def test_program_name_in_help(self):
|
||||
out, err = self.run_test('-m', ['django', 'help'])
|
||||
self.assertOutput(out, "Type 'python -m django help <subcommand>' for help on a specific subcommand.")
|
||||
|
||||
|
||||
class DjangoAdminSuggestions(AdminScriptTestCase):
|
||||
def setUp(self):
|
||||
self.write_settings('settings.py')
|
||||
|
||||
def tearDown(self):
|
||||
self.remove_settings('settings.py')
|
||||
|
||||
def test_suggestions(self):
|
||||
args = ['rnserver', '--settings=test_project.settings']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertNoOutput(out)
|
||||
self.assertOutput(err, "Unknown command: 'rnserver'. Did you mean runserver?")
|
||||
|
||||
def test_no_suggestions(self):
|
||||
args = ['abcdef', '--settings=test_project.settings']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertNoOutput(out)
|
||||
self.assertNotInOutput(err, 'Did you mean')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue