File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import absolute_import , division , unicode_literals
2
2
3
- from html5lib import constants
4
- from html5lib import parseFragment , serialize
3
+ from html5lib import constants , parseFragment , serialize
5
4
from html5lib .filters import sanitizer
6
5
7
6
@@ -29,11 +28,15 @@ def sanitize_html(stream):
29
28
30
29
31
30
def test_should_handle_astral_plane_characters ():
32
- assert '<p>\U0001d4b5 \U0001d538 </p>' == sanitize_html ("<p>𝒵 𝔸</p>" )
31
+ sanitized = sanitize_html ("<p>𝒵 𝔸</p>" )
32
+ expected = '<p>\U0001d4b5 \U0001d538 </p>'
33
+ assert expected == sanitized
33
34
34
35
35
36
def test_should_allow_relative_uris ():
36
- assert '<p><a href="/example.com"></a></p>' == sanitize_html ('<p><a href="/example.com"></a></p>' )
37
+ sanitized = sanitize_html ('<p><a href="/example.com"></a></p>' )
38
+ expected = '<p><a href="/example.com"></a></p>'
39
+ assert expected == sanitized
37
40
38
41
39
42
def test_sanitizer ():
You can’t perform that action at this time.
0 commit comments