diff options
Diffstat (limited to 'tests/template_tests/syntax_tests/test_basic.py')
| -rw-r--r-- | tests/template_tests/syntax_tests/test_basic.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/template_tests/syntax_tests/test_basic.py b/tests/template_tests/syntax_tests/test_basic.py index da45fe2839..0a1c10cee8 100644 --- a/tests/template_tests/syntax_tests/test_basic.py +++ b/tests/template_tests/syntax_tests/test_basic.py @@ -61,7 +61,7 @@ class BasicSyntaxTests(SimpleTestCase): """ Raise TemplateSyntaxError for empty variable tags. """ - with self.assertRaises(TemplateSyntaxError): + with self.assertRaisesMessage(TemplateSyntaxError, 'Empty variable tag on line 1'): self.engine.get_template('basic-syntax07') @setup({'basic-syntax08': '{{ }}'}) @@ -69,7 +69,7 @@ class BasicSyntaxTests(SimpleTestCase): """ Raise TemplateSyntaxError for empty variable tags. """ - with self.assertRaises(TemplateSyntaxError): + with self.assertRaisesMessage(TemplateSyntaxError, 'Empty variable tag on line 1'): self.engine.get_template('basic-syntax08') @setup({'basic-syntax09': '{{ var.method }}'}) @@ -314,13 +314,13 @@ class BasicSyntaxTests(SimpleTestCase): @setup({'template': '{% block content %}'}) def test_unclosed_block(self): - msg = "Unclosed tag 'block'. Looking for one of: endblock." + msg = "Unclosed tag on line 1: 'block'. Looking for one of: endblock." with self.assertRaisesMessage(TemplateSyntaxError, msg): self.engine.render_to_string('template') @setup({'template': '{% if a %}'}) def test_unclosed_block2(self): - msg = "Unclosed tag 'if'. Looking for one of: elif, else, endif." + msg = "Unclosed tag on line 1: 'if'. Looking for one of: elif, else, endif." with self.assertRaisesMessage(TemplateSyntaxError, msg): self.engine.render_to_string('template') |
