Skip to content

Commit

Permalink
Fixed override_settings usage in test_client_regress
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Jun 2, 2012
1 parent ade44b8 commit 566ac30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/regressiontests/test_client_regress/tests.py
Expand Up @@ -609,7 +609,6 @@ def test_exception_cleared(self):
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.
Expand All @@ -618,6 +617,7 @@ def setUp(self):
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:
Expand All @@ -626,9 +626,11 @@ def test_no_404_template(self):
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")
Expand Down

0 comments on commit 566ac30

Please sign in to comment.