summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-03-22 14:21:31 +0100
committerClaude Paroz <claude@2xlibre.net>2014-03-22 14:21:35 +0100
commitf05f5c231a916082b5fa2e0980fbf7abeb390032 (patch)
tree033b0e329331760313726fa4eb634998aac76dde /tests
parent5f7b3e56cea045d177589c673c682c69bd6ed709 (diff)
[1.6.x] Removed a strip_tags test for older Python versions
Django's custom HTMLParser for older Python versions cannot parse convoluted syntax.
Diffstat (limited to 'tests')
-rw-r--r--tests/utils_tests/test_html.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py
index b4e3d28db9..4774bea684 100644
--- a/tests/utils_tests/test_html.py
+++ b/tests/utils_tests/test_html.py
@@ -63,6 +63,7 @@ class TestUtilsHtml(TestCase):
self.check_output(f, value, output)
def test_strip_tags(self):
+ from django.utils.html_parser import use_workaround
f = html.strip_tags
items = (
('<p>See: &#39;&eacute; is an apostrophe followed by e acute</p>',
@@ -80,9 +81,10 @@ class TestUtilsHtml(TestCase):
('a<p a >b</p>c', 'abc'),
('d<a:b c:d>e</p>f', 'def'),
('<strong>foo</strong><a href="http://example.com">bar</a>', 'foobar'),
- ('<sc<!-- -->ript>test<<!-- -->/script>', 'test'),
('<script>alert()</script>&h', 'alert()&h'),
)
+ if not use_workaround:
+ items += (('<sc<!-- -->ript>test<<!-- -->/script>', 'test'),)
for value, output in items:
self.check_output(f, value, output)