Skip to content

Commit

Permalink
[1.6.x] Removed a strip_tags test for older Python versions
Browse files Browse the repository at this point in the history
Django's custom HTMLParser for older Python versions cannot
parse convoluted syntax.
  • Loading branch information
claudep committed Mar 22, 2014
1 parent 5f7b3e5 commit f05f5c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/utils_tests/test_html.py
Expand Up @@ -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 = (
('<p>See: &#39;&eacute; is an apostrophe followed by e acute</p>',
Expand All @@ -80,9 +81,10 @@ def test_strip_tags(self):
('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)

Expand Down

0 comments on commit f05f5c2

Please sign in to comment.