summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2015-03-06 21:56:11 +0100
committerClaude Paroz <claude@2xlibre.net>2015-03-06 22:22:51 +0100
commitac07890f959c467b3fc9c6dd6d36aafc2eff1fcc (patch)
tree06065cdd86c2d2c1413e11c1a57a19f050c7c495 /tests
parent823f8cdbc91f85a8ab3cb1ccfec5659037b5c148 (diff)
[1.8.x] Fixed urlize regression with entities in query strings
Refs #22267. Thanks Shai Berger for spotting the issue and Tim Graham for the initial patch. Backport of ec808e807 from master.
Diffstat (limited to 'tests')
-rw-r--r--tests/template_tests/filter_tests/test_urlize.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/template_tests/filter_tests/test_urlize.py b/tests/template_tests/filter_tests/test_urlize.py
index 716bf9e6f5..1c55d64751 100644
--- a/tests/template_tests/filter_tests/test_urlize.py
+++ b/tests/template_tests/filter_tests/test_urlize.py
@@ -73,6 +73,14 @@ class UrlizeTests(SimpleTestCase):
'Email me at &lt;<a href="mailto:me@example.com">me@example.com</a>&gt;',
)
+ @setup({'urlize09': '{% autoescape off %}{{ a|urlize }}{% endautoescape %}'})
+ def test_urlize09(self):
+ output = self.engine.render_to_string('urlize09', {'a': "http://example.com/?x=&amp;y=&lt;2&gt;"})
+ self.assertEqual(
+ output,
+ '<a href="http://example.com/?x=&y=%3C2%3E" rel="nofollow">http://example.com/?x=&amp;y=&lt;2&gt;</a>',
+ )
+
class FunctionTests(SimpleTestCase):