File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11from __future__ import absolute_import , division , unicode_literals
22
3- from html5lib import constants
4- from html5lib import parseFragment , serialize
3+ from html5lib import constants , parseFragment , serialize
54from html5lib .filters import sanitizer
65
76
@@ -29,11 +28,15 @@ def sanitize_html(stream):
2928
3029
3130def 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
3334
3435
3536def 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
3740
3841
3942def test_sanitizer ():
You can’t perform that action at this time.
0 commit comments