Skip to content

Commit 8dc6d85

Browse files
committed
Remove one xfail for addslashes that actually didn't use autoescape
1 parent ee5481f commit 8dc6d85

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tests/filters/test_addslashes.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,12 @@ def test_addslashes01(self):
2525
self.assertEqual(output, r"<a>\' <a>\'")
2626

2727

28-
@pytest.mark.xfail(reason="autoescape not there yet")
29-
def test_addslashes02(self):
30-
"""@setup({"addslashes02": "{{ a|addslashes }} {{ b|addslashes }}"})"""
28+
def test_addslashes02(assert_render):
3129
template = "{{ a|addslashes }} {{ b|addslashes }}"
30+
context = {"a": "<a>'", "b": mark_safe("<a>'")}
31+
expected = r"&lt;a&gt;\&#x27; <a>\'"
3232

33-
django_template = engines["django"].from_string(template) # noqa
34-
rust_template = engines["rusty"].from_string(template) # noqa
35-
36-
output = self.engine.render_to_string(
37-
"addslashes02", {"a": "<a>'", "b": mark_safe("<a>'")}
38-
)
39-
self.assertEqual(output, r"&lt;a&gt;\&#x27; <a>\'")
33+
assert_render(template, context, expected)
4034

4135

4236
def test_quotes(assert_render):

0 commit comments

Comments
 (0)