From c9b2feffeed46765ed6c4b74066059e2a6541735 Mon Sep 17 00:00:00 2001
From: Claude Paroz
Date: Sat, 22 Mar 2014 14:41:45 +0100
Subject: [PATCH] [1.6.x] Tweaked strip_tags tests to pass on Python 3.3
Backport of 6a0291bda from master.
---
tests/utils_tests/test_html.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py
index 4774bea684..9c1f22f01f 100644
--- a/tests/utils_tests/test_html.py
+++ b/tests/utils_tests/test_html.py
@@ -63,7 +63,6 @@ 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 = (
('See: 'é is an apostrophe followed by e acute
',
@@ -81,13 +80,18 @@ class TestUtilsHtml(TestCase):
('ab
c', 'abc'),
('de
f', 'def'),
('foobar', 'foobar'),
- ('&h', 'alert()&h'),
)
- if not use_workaround:
- items += (('ript>test</script>', 'test'),)
for value, output in items:
self.check_output(f, value, output)
+ # Some convoluted syntax for which parsing may differ between python versions
+ output = html.strip_tags('ript>test</script>')
+ self.assertNotIn('&h')
+ self.assertNotIn('