Ticket #19070: test_urlize.diff

File test_urlize.diff, 805 bytes (added by andrea_crotti, 12 years ago)

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

  • tests/defaultfilters/tests.py

    diff --git a/tests/defaultfilters/tests.py b/tests/defaultfilters/tests.py
    index 21734fa..f27b731 100644
    a b class DefaultFiltersTests(TestCase):  
    320320        self.assertEqual(urlize('http://[2001:db8:cafe::2]/api/9'),
    321321            '<a href="http://[2001:db8:cafe::2]/api/9" rel="nofollow">http://[2001:db8:cafe::2]/api/9</a>')
    322322
     323        # Check urlize works with does not raise a ValueError anymore
     324        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>')
     325
    323326    def test_wordcount(self):
    324327        self.assertEqual(wordcount(''), 0)
    325328        self.assertEqual(wordcount('oneword'), 1)
Back to Top