summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2016-02-11 20:37:34 -0800
committerTim Graham <timograham@gmail.com>2016-02-15 09:10:15 -0500
commitdec334cb66b3ee59cb82e1bb99a584aa0b9fbbd5 (patch)
tree772e42ce55dbb410b6426e098f5a83d54de678d9 /tests
parentfcd08c175787e909b3eb98f756317a07741c48dd (diff)
Fixed #26193 -- Made urlize() trim multiple trailing punctuation.
Diffstat (limited to 'tests')
-rw-r--r--tests/template_tests/filter_tests/test_urlize.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/template_tests/filter_tests/test_urlize.py b/tests/template_tests/filter_tests/test_urlize.py
index 9cf3f982a8..6822092943 100644
--- a/tests/template_tests/filter_tests/test_urlize.py
+++ b/tests/template_tests/filter_tests/test_urlize.py
@@ -246,6 +246,24 @@ class FunctionTests(SimpleTestCase):
'(Go to <a href="http://www.example.com/foo" rel="nofollow">http://www.example.com/foo</a>.)',
)
+ def test_trailing_multiple_punctuation(self):
+ self.assertEqual(
+ urlize('A test http://testing.com/example..'),
+ 'A test <a href="http://testing.com/example" rel="nofollow">http://testing.com/example</a>..'
+ )
+ self.assertEqual(
+ urlize('A test http://testing.com/example!!'),
+ 'A test <a href="http://testing.com/example" rel="nofollow">http://testing.com/example</a>!!'
+ )
+ self.assertEqual(
+ urlize('A test http://testing.com/example!!!'),
+ 'A test <a href="http://testing.com/example" rel="nofollow">http://testing.com/example</a>!!!'
+ )
+ self.assertEqual(
+ urlize('A test http://testing.com/example.,:;)"!'),
+ 'A test <a href="http://testing.com/example" rel="nofollow">http://testing.com/example</a>.,:;)&quot;!'
+ )
+
def test_brackets(self):
"""
#19070 - Check urlize handles brackets properly