3 | | {{{#!diff |
4 | | diff --git a/tests/template_tests/syntax_tests/test_partials.py b/tests/template_tests/syntax_tests/test_partials.py |
5 | | index a2cd3ae96a..6098531ed9 100644 |
6 | | --- a/tests/template_tests/syntax_tests/test_partials.py |
7 | | +++ b/tests/template_tests/syntax_tests/test_partials.py |
8 | | @@ -484,6 +484,11 @@ class PartialTagTests(SimpleTestCase): |
9 | | { |
10 | | "partial_with_syntax_error": ( |
11 | | "<h1>Title</h1>\n" |
12 | | + "{% verbatim %}\n" |
13 | | + "{% partialdef syntax_error_partial %}\n" |
14 | | + "VERBATIM\n" |
15 | | + "{% endpartialdef %}\n" |
16 | | + "{% endverbatim %}\n" |
17 | | "{% partialdef syntax_error_partial %}\n" |
18 | | " {% if user %}\n" |
19 | | " <p>User: {{ user.name }}</p>\n" |
20 | | @@ -506,6 +511,7 @@ class PartialTagTests(SimpleTestCase): |
21 | | self.assertIn("endpartialdef", exc_debug["during"]) |
22 | | self.assertEqual(exc_debug["name"], "partial_with_syntax_error") |
23 | | self.assertIn("endif", exc_debug["message"].lower()) |
24 | | + self.assertNotIn("verbatim", exc_debug["source_lines"][0][1]) |
25 | | |
26 | | @setup( |
27 | | { |
| 3 | {{{#!py |
| 4 | @setup( |
| 5 | { |
| 6 | "partial_embedded_in_verbatim": ( |
| 7 | "{% verbatim %}\n" |
| 8 | "{% partialdef testing-name %}\n" |
| 9 | "{% endverbatim %}\n" |
| 10 | "{% partialdef testing-name %}\n" |
| 11 | "<p>Content</p>\n" |
| 12 | "{% endpartialdef %}\n" |
| 13 | ), |
| 14 | }, |
| 15 | test_once=True, |
| 16 | ) |
| 17 | def test_partial_template_embedded_in_verbatim(self): |
| 18 | template = self.engine.get_template("partial_embedded_in_verbatim") |
| 19 | partial_template = template.extra_data["partials"]["testing-name"] |
| 20 | self.assertIn("Content", partial_template.source) |
40 | | File "/Users/jwalls/django/tests/template_tests/syntax_tests/test_partials.py", line 514, in test_partial_with_syntax_error_exception_info |
41 | | self.assertNotIn("verbatim", exc_debug["source_lines"][0][1]) |
42 | | AssertionError: 'verbatim' unexpectedly found in '{% verbatim %}\n' |
| 33 | File "/Users/jwalls/django/tests/template_tests/syntax_tests/test_partials.py", line 676, in test_partial_template_embedded_in_verbatim |
| 34 | self.assertIn("Content", partial_template.source) |
| 35 | AssertionError: 'Content' not found in '' |