File tree 1 file changed +4
-11
lines changed
1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 4
4
"""
5
5
6
6
import pytest
7
- from django .template import engines
8
7
from django .utils .safestring import mark_safe
9
8
10
9
@@ -26,18 +25,12 @@ def test_addslashes01(self):
26
25
self .assertEqual (output , r"<a>\' <a>\'" )
27
26
28
27
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 ):
32
29
template = "{{ a|addslashes }} {{ b|addslashes }}"
30
+ context = {"a" : "<a>'" , "b" : mark_safe ("<a>'" )}
31
+ expected = r"<a>\' <a>\'"
33
32
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"<a>\' <a>\'" )
33
+ assert_render (template , context , expected )
41
34
42
35
43
36
def test_quotes (assert_render ):
You can’t perform that action at this time.
0 commit comments