mirror of
https://github.com/django/django.git
synced 2025-08-30 23:37:50 +00:00
Fixed #28791 -- Allowed commands that don't require settings to work if the DJANGO_SETTINGS_MODULE doesn't exist.
This commit is contained in:
parent
16bd4964df
commit
c6864a01b2
2 changed files with 12 additions and 0 deletions
|
@ -236,6 +236,16 @@ class DjangoAdminNoSettings(AdminScriptTestCase):
|
|||
self.assertNoOutput(out)
|
||||
self.assertOutput(err, "No module named '?bad_settings'?", regex=True)
|
||||
|
||||
def test_commands_with_invalid_settings(self):
|
||||
""""
|
||||
Commands that don't require settings succeed if the settings file
|
||||
doesn't exist.
|
||||
"""
|
||||
args = ['startproject']
|
||||
out, err = self.run_django_admin(args, settings_file='bad_settings')
|
||||
self.assertNoOutput(out)
|
||||
self.assertOutput(err, "You must provide a project name", regex=True)
|
||||
|
||||
|
||||
class DjangoAdminDefaultSettings(AdminScriptTestCase):
|
||||
"""A series of tests for django-admin.py when using a settings.py file that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue