Skip to content

Commit 98e50c9

Browse files
committed
Remove one xfail for addslashes that actually didn't use autoescape
1 parent d549fbe commit 98e50c9

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
@@ -26,18 +26,12 @@ def test_addslashes01(self):
2626
self.assertEqual(output, r"<a>\' <a>\'")
2727

2828

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

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

4236

4337
def test_quotes(assert_render):

0 commit comments

Comments
 (0)