Skip to content

Commit 7095079

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

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tests/filters/test_addslashes.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55

66
import pytest
7-
from django.template import engines
87
from django.utils.safestring import mark_safe
98

109

@@ -26,18 +25,12 @@ def test_addslashes01(self):
2625
self.assertEqual(output, r"<a>\' <a>\'")
2726

2827

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

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>\'")
33+
assert_render(template, context, expected)
4134

4235

4336
def test_quotes(assert_render):

0 commit comments

Comments
 (0)