diff --git a/tests/template_tests/syntax_tests/test_for.py b/tests/template_tests/syntax_tests/test_for.py index 2891d16f67..afdffb892b 100644 --- a/tests/template_tests/syntax_tests/test_for.py +++ b/tests/template_tests/syntax_tests/test_for.py @@ -71,17 +71,20 @@ class ForTagTests(SimpleTestCase): @setup({'for-tag-unpack06': '{% for key value in items %}{{ key }}:{{ value }}/{% endfor %}'}) def test_for_tag_unpack06(self): - with self.assertRaises(TemplateSyntaxError): + msg = "'for' tag received an invalid argument: for key value in items" + with self.assertRaisesMessage(TemplateSyntaxError, msg): self.engine.render_to_string('for-tag-unpack06', {'items': (('one', 1), ('two', 2))}) @setup({'for-tag-unpack07': '{% for key,,value in items %}{{ key }}:{{ value }}/{% endfor %}'}) def test_for_tag_unpack07(self): - with self.assertRaises(TemplateSyntaxError): + msg = "'for' tag received an invalid argument: for key,,value in items" + with self.assertRaisesMessage(TemplateSyntaxError, msg): self.engine.render_to_string('for-tag-unpack07', {'items': (('one', 1), ('two', 2))}) @setup({'for-tag-unpack08': '{% for key,value, in items %}{{ key }}:{{ value }}/{% endfor %}'}) def test_for_tag_unpack08(self): - with self.assertRaises(TemplateSyntaxError): + msg = "'for' tag received an invalid argument: for key,value, in items" + with self.assertRaisesMessage(TemplateSyntaxError, msg): self.engine.render_to_string('for-tag-unpack08', {'items': (('one', 1), ('two', 2))}) @setup({'for-tag-unpack09': '{% for val in items %}{{ val.0 }}:{{ val.1 }}/{% endfor %}'})