mirror of
https://github.com/django/django.git
synced 2025-03-13 10:50:55 +00:00
[1.6.x] Removed a strip_tags test for older Python versions
Django's custom HTMLParser for older Python versions cannot parse convoluted syntax.
This commit is contained in:
parent
5f7b3e56ce
commit
f05f5c231a
@ -63,6 +63,7 @@ class TestUtilsHtml(TestCase):
|
|||||||
self.check_output(f, value, output)
|
self.check_output(f, value, output)
|
||||||
|
|
||||||
def test_strip_tags(self):
|
def test_strip_tags(self):
|
||||||
|
from django.utils.html_parser import use_workaround
|
||||||
f = html.strip_tags
|
f = html.strip_tags
|
||||||
items = (
|
items = (
|
||||||
('<p>See: 'é is an apostrophe followed by e acute</p>',
|
('<p>See: 'é is an apostrophe followed by e acute</p>',
|
||||||
@ -80,9 +81,10 @@ class TestUtilsHtml(TestCase):
|
|||||||
('a<p a >b</p>c', 'abc'),
|
('a<p a >b</p>c', 'abc'),
|
||||||
('d<a:b c:d>e</p>f', 'def'),
|
('d<a:b c:d>e</p>f', 'def'),
|
||||||
('<strong>foo</strong><a href="http://example.com">bar</a>', 'foobar'),
|
('<strong>foo</strong><a href="http://example.com">bar</a>', 'foobar'),
|
||||||
('<sc<!-- -->ript>test<<!-- -->/script>', 'test'),
|
|
||||||
('<script>alert()</script>&h', 'alert()&h'),
|
('<script>alert()</script>&h', 'alert()&h'),
|
||||||
)
|
)
|
||||||
|
if not use_workaround:
|
||||||
|
items += (('<sc<!-- -->ript>test<<!-- -->/script>', 'test'),)
|
||||||
for value, output in items:
|
for value, output in items:
|
||||||
self.check_output(f, value, output)
|
self.check_output(f, value, output)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user