|
1 | 1 | from __future__importabsolute_import,division,unicode_literals |
2 | 2 |
|
3 | | -fromhtml5libimportconstants |
4 | | -fromhtml5libimportparseFragment,serialize |
| 3 | +fromhtml5libimportconstants,parseFragment,serialize |
5 | 4 | fromhtml5lib.filtersimportsanitizer |
6 | 5 |
|
7 | 6 |
|
@@ -29,11 +28,15 @@ def sanitize_html(stream): |
29 | 28 |
|
30 | 29 |
|
31 | 30 | deftest_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 | +assertexpected==sanitized |
33 | 34 |
|
34 | 35 |
|
35 | 36 | deftest_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 | +assertexpected==sanitized |
37 | 40 |
|
38 | 41 |
|
39 | 42 | deftest_sanitizer(): |
|