From c6864a01b25591d3a709da8071413b69c9e35341 Mon Sep 17 00:00:00 2001 From: geekodour Date: Mon, 20 Nov 2017 12:32:14 +0530 Subject: Fixed #28791 -- Allowed commands that don't require settings to work if the DJANGO_SETTINGS_MODULE doesn't exist. --- tests/admin_scripts/tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/admin_scripts') 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 -- cgit v1.3