From f05f5c231a916082b5fa2e0980fbf7abeb390032 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 22 Mar 2014 14:21:31 +0100 Subject: [PATCH] [1.6.x] Removed a strip_tags test for older Python versions Django's custom HTMLParser for older Python versions cannot parse convoluted syntax. --- tests/utils_tests/test_html.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py index b4e3d28db98a5..4774bea684a28 100644 --- a/tests/utils_tests/test_html.py +++ b/tests/utils_tests/test_html.py @@ -63,6 +63,7 @@ def test_linebreaks(self): self.check_output(f, value, output) def test_strip_tags(self): + from django.utils.html_parser import use_workaround f = html.strip_tags items = ( ('

See: 'é is an apostrophe followed by e acute

', @@ -80,9 +81,10 @@ def test_strip_tags(self): ('a

b

c', 'abc'), ('de

f', 'def'), ('foobar', 'foobar'), - ('ript>test</script>', 'test'), ('&h', 'alert()&h'), ) + if not use_workaround: + items += (('ript>test</script>', 'test'),) for value, output in items: self.check_output(f, value, output)