summaryrefslogtreecommitdiff
path: root/tests/admin_scripts/tests.py
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-06-19 12:03:20 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-06-19 12:05:23 +0100
commit9daf81b94e7945d7adfdf62206cf9cb436166f0d (patch)
tree0ca2a77977432d0c139886297afb433569b588ca /tests/admin_scripts/tests.py
parent315ab41e416c777d4f42932d42df07872e8f8895 (diff)
parentd9a43545be1af95a13c181c8b178f5631d3a4148 (diff)
Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts: django/db/models/loading.py
Diffstat (limited to 'tests/admin_scripts/tests.py')
-rw-r--r--tests/admin_scripts/tests.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 9e6b1f557b..2f399acb23 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -1192,6 +1192,21 @@ class ManageRunserver(AdminScriptTestCase):
self.cmd.handle(addrport="deadbeef:7654")
self.assertServerSettings('deadbeef', '7654')
+class ManageRunserverEmptyAllowedHosts(AdminScriptTestCase):
+ def setUp(self):
+ self.write_settings('settings.py', sdict={
+ 'ALLOWED_HOSTS': [],
+ 'DEBUG': False,
+ })
+
+ def tearDown(self):
+ self.remove_settings('settings.py')
+
+ def test_empty_allowed_hosts_error(self):
+ out, err = self.run_manage(['runserver'])
+ self.assertNoOutput(out)
+ self.assertOutput(err, 'CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False.')
+
##########################################################################
# COMMAND PROCESSING TESTS
@@ -1459,6 +1474,13 @@ class ArgumentOrder(AdminScriptTestCase):
class StartProject(LiveServerTestCase, AdminScriptTestCase):
+ available_apps = [
+ 'admin_scripts',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ ]
+
def test_wrong_args(self):
"Make sure passing the wrong kinds of arguments raises a CommandError"
out, err = self.run_django_admin(['startproject'])