diff --git a/isso/tests/test_html.py b/isso/tests/test_html.py index 327357c..42baa82 100644 --- a/isso/tests/test_html.py +++ b/isso/tests/test_html.py @@ -65,13 +65,17 @@ class TestHTML(unittest.TestCase): examples = [ ('Look: ', 'Look: '), ('Ha', - 'Ha'), + ['Ha', + 'Ha']), ('Ha', 'Ha'), ('
', 'Test
'), ('', 'alert("Onoe")')] for (input, expected) in examples: - self.assertEqual(html.sanitize(sanitizer, input), expected) + if isinstance(expected, list): + self.assertIn(html.sanitize(sanitizer, input), expected) + else: + self.assertEqual(html.sanitize(sanitizer, input), expected) @unittest.skipIf(html.HTML5LIB_VERSION <= html.HTML5LIB_SIMPLETREE, "backport") def test_sanitizer_extensions(self): @@ -92,5 +96,6 @@ class TestHTML(unittest.TestCase): } }) renderer = html.Markup(conf.section("markup")).render - self.assertEqual(renderer("http://example.org/ and sms:+1234567890"), - 'http://example.org/ and sms:+1234567890
') + self.assertIn(renderer("http://example.org/ and sms:+1234567890"), + ['http://example.org/ and sms:+1234567890
', + 'http://example.org/ and sms:+1234567890
'])