summaryrefslogtreecommitdiff
path: root/tests/template_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/syntax_tests/test_include.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/template_tests/syntax_tests/test_include.py b/tests/template_tests/syntax_tests/test_include.py
index 8587639674..b840c676f7 100644
--- a/tests/template_tests/syntax_tests/test_include.py
+++ b/tests/template_tests/syntax_tests/test_include.py
@@ -201,9 +201,8 @@ class IncludeTests(SimpleTestCase):
"""
engine = Engine(app_dirs=True, debug=True)
template = engine.get_template('test_include_error.html')
- with self.assertRaises(TemplateDoesNotExist) as e:
+ with self.assertRaisesMessage(TemplateDoesNotExist, 'missing.html'):
template.render(Context())
- self.assertEqual(e.exception.args[0], 'missing.html')
def test_extends_include_missing_baseloader(self):
"""
@@ -213,9 +212,8 @@ class IncludeTests(SimpleTestCase):
"""
engine = Engine(app_dirs=True, debug=True)
template = engine.get_template('test_extends_error.html')
- with self.assertRaises(TemplateDoesNotExist) as e:
+ with self.assertRaisesMessage(TemplateDoesNotExist, 'missing.html'):
template.render(Context())
- self.assertEqual(e.exception.args[0], 'missing.html')
def test_extends_include_missing_cachedloader(self):
engine = Engine(debug=True, loaders=[
@@ -225,15 +223,13 @@ class IncludeTests(SimpleTestCase):
])
template = engine.get_template('test_extends_error.html')
- with self.assertRaises(TemplateDoesNotExist) as e:
+ with self.assertRaisesMessage(TemplateDoesNotExist, 'missing.html'):
template.render(Context())
- self.assertEqual(e.exception.args[0], 'missing.html')
# Repeat to ensure it still works when loading from the cache
template = engine.get_template('test_extends_error.html')
- with self.assertRaises(TemplateDoesNotExist) as e:
+ with self.assertRaisesMessage(TemplateDoesNotExist, 'missing.html'):
template.render(Context())
- self.assertEqual(e.exception.args[0], 'missing.html')
def test_include_template_argument(self):
"""