Code

Ticket #19070: test_urlize.diff

File test_urlize.diff, 805 bytes (added by andrea_crotti, 14 months ago)

This adds a test that shows that the behaviour of urlize described here does not fail on 1.6.0

Line 
1diff --git a/tests/defaultfilters/tests.py b/tests/defaultfilters/tests.py
2index 21734fa..f27b731 100644
3--- a/tests/defaultfilters/tests.py
4+++ b/tests/defaultfilters/tests.py
5@@ -320,6 +320,9 @@ class DefaultFiltersTests(TestCase):
6         self.assertEqual(urlize('http://[2001:db8:cafe::2]/api/9'),
7             '<a href="http://[2001:db8:cafe::2]/api/9" rel="nofollow">http://[2001:db8:cafe::2]/api/9</a>')
8 
9+        # Check urlize works with does not raise a ValueError anymore
10+        self.assertEqual(urlize('[http://168.192.0.1](http://168.192.0.1)'), u'[<a href="http://168.192.0.1](http://168.192.0.1)" rel="nofollow">http://168.192.0.1](http://168.192.0.1)</a>')
11+
12     def test_wordcount(self):
13         self.assertEqual(wordcount(''), 0)
14         self.assertEqual(wordcount('oneword'), 1)