summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorgeekodour <hrishikeshbman@gmail.com>2017-11-20 12:32:14 +0530
committerTim Graham <timograham@gmail.com>2017-12-07 14:19:18 -0500
commitc6864a01b25591d3a709da8071413b69c9e35341 (patch)
tree0828a224d6ddc7221faff9b43592fd730b759191 /tests/admin_scripts
parent16bd4964dfd75759cb3ec0c786e1b5dcc8296fd9 (diff)
downloaddjango-c6864a01b25591d3a709da8071413b69c9e35341.tar.gz
Fixed #28791 -- Allowed commands that don't require settings to work if the DJANGO_SETTINGS_MODULE doesn't exist.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index e56d43c4bc..1670af86fb 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -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