Fixed override_settings usage in test_client_regress

This commit is contained in:
Claude Paroz 2012-06-02 19:50:24 +02:00
parent ade44b8d40
commit 566ac30eb9
1 changed files with 4 additions and 2 deletions

View File

@ -609,7 +609,6 @@ class ExceptionTests(TestCase):
self.fail("Staff should be able to visit this page") self.fail("Staff should be able to visit this page")
@override_settings(TEMPLATE_DIRS=())
class TemplateExceptionTests(TestCase): class TemplateExceptionTests(TestCase):
def setUp(self): def setUp(self):
# Reset the loaders so they don't try to render cached templates. # Reset the loaders so they don't try to render cached templates.
@ -618,6 +617,7 @@ class TemplateExceptionTests(TestCase):
if hasattr(template_loader, 'reset'): if hasattr(template_loader, 'reset'):
template_loader.reset() template_loader.reset()
@override_settings(TEMPLATE_DIRS=(),)
def test_no_404_template(self): def test_no_404_template(self):
"Missing templates are correctly reported by test client" "Missing templates are correctly reported by test client"
try: try:
@ -626,9 +626,11 @@ class TemplateExceptionTests(TestCase):
except TemplateDoesNotExist: except TemplateDoesNotExist:
pass pass
@override_settings(
TEMPLATE_DIRS=(os.path.join(os.path.dirname(__file__), 'bad_templates'),)
)
def test_bad_404_template(self): def test_bad_404_template(self):
"Errors found when rendering 404 error templates are re-raised" "Errors found when rendering 404 error templates are re-raised"
settings.TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'bad_templates'),)
try: try:
response = self.client.get("/no_such_view/") response = self.client.get("/no_such_view/")
self.fail("Should get error about syntax error in template") self.fail("Should get error about syntax error in template")