summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Beaven <smileychris@gmail.com>2012-02-22 00:42:19 +0000
committerChris Beaven <smileychris@gmail.com>2012-02-22 00:42:19 +0000
commit3ac0961e1ec3f935474e3c1c3f16bee1cc5ae54a (patch)
treee02703019f19c71d4ac82a5cda27225fea18e9d0 /tests
parenta3bb4df8956185c345e3a4c68df15ad7286788b0 (diff)
Don't let ALLOWED_INCLUDE_ROOTS be accidentally set to a string rather than a tuple. Thanks to Florian Apolloner for pointing this out.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17571 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/settings_tests/tests.py7
-rw-r--r--tests/regressiontests/templates/tests.py4
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/regressiontests/settings_tests/tests.py b/tests/regressiontests/settings_tests/tests.py
index c250aea1ac..3f57fcead2 100644
--- a/tests/regressiontests/settings_tests/tests.py
+++ b/tests/regressiontests/settings_tests/tests.py
@@ -150,6 +150,13 @@ class SettingsTests(TestCase):
def test_settings_delete_wrapped(self):
self.assertRaises(TypeError, delattr, settings, '_wrapped')
+ def test_allowed_include_roots_string(self):
+ """
+ ALLOWED_INCLUDE_ROOTS is not allowed to be incorrectly set to a string
+ rather than a tuple.
+ """
+ self.assertRaises(ValueError, setattr, settings,
+ 'ALLOWED_INCLUDE_ROOTS', '/var/www/ssi/')
class TrailingSlashURLTests(TestCase):
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index d5de05ca09..f74aa757e6 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -425,7 +425,9 @@ class Templates(unittest.TestCase):
#Set ALLOWED_INCLUDE_ROOTS so that ssi works.
old_allowed_include_roots = settings.ALLOWED_INCLUDE_ROOTS
- settings.ALLOWED_INCLUDE_ROOTS = os.path.dirname(os.path.abspath(__file__))
+ settings.ALLOWED_INCLUDE_ROOTS = (
+ os.path.dirname(os.path.abspath(__file__)),
+ )
# Warm the URL reversing cache. This ensures we don't pay the cost
# warming the cache during one of the tests.