summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-06-02 19:50:24 +0200
committerClaude Paroz <claude@2xlibre.net>2012-06-02 19:50:24 +0200
commit566ac30eb92574f698a848739fa5008d5e08a2ee (patch)
treeddc4a66a1d9f74bf1827f471dbfbfb2044a9d544
parentade44b8d402c425ca687f254bbaaf161522e5c04 (diff)
Fixed override_settings usage in test_client_regress
-rw-r--r--tests/regressiontests/test_client_regress/tests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/regressiontests/test_client_regress/tests.py b/tests/regressiontests/test_client_regress/tests.py
index 293c0ff557..ece487a211 100644
--- a/tests/regressiontests/test_client_regress/tests.py
+++ b/tests/regressiontests/test_client_regress/tests.py
@@ -609,7 +609,6 @@ class ExceptionTests(TestCase):
self.fail("Staff should be able to visit this page")
-@override_settings(TEMPLATE_DIRS=())
class TemplateExceptionTests(TestCase):
def setUp(self):
# Reset the loaders so they don't try to render cached templates.
@@ -618,6 +617,7 @@ class TemplateExceptionTests(TestCase):
if hasattr(template_loader, 'reset'):
template_loader.reset()
+ @override_settings(TEMPLATE_DIRS=(),)
def test_no_404_template(self):
"Missing templates are correctly reported by test client"
try:
@@ -626,9 +626,11 @@ class TemplateExceptionTests(TestCase):
except TemplateDoesNotExist:
pass
+ @override_settings(
+ TEMPLATE_DIRS=(os.path.join(os.path.dirname(__file__), 'bad_templates'),)
+ )
def test_bad_404_template(self):
"Errors found when rendering 404 error templates are re-raised"
- settings.TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'bad_templates'),)
try:
response = self.client.get("/no_such_view/")
self.fail("Should get error about syntax error in template")