diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-08 15:43:32 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-08 15:43:32 +0000 |
| commit | 27508918fbbbfda6f5e3b697bbea6bf2c4a6b8b8 (patch) | |
| tree | dc9b0ce8a4ad9e95a9b249cfab1e28f07e3b3450 /tests | |
| parent | 40f0ecc56a23d35c2849f8e79276f6d8931412d1 (diff) | |
Fixed #16395 -- Prevented urlize from highlighting some malformed URLs. Thanks BernhardEssl for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17358 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/defaultfilters/tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/defaultfilters/tests.py b/tests/regressiontests/defaultfilters/tests.py index 2c7cdb17a6..2f3d012346 100644 --- a/tests/regressiontests/defaultfilters/tests.py +++ b/tests/regressiontests/defaultfilters/tests.py @@ -268,6 +268,14 @@ class DefaultFiltersTests(TestCase): self.assertEqual(urlize('info@c✶.org'), u'<a href="mailto:info@xn--c-lgq.org">info@c✶.org</a>') + # Check urlize doesn't highlight malformed URIs - see #16395 + self.assertEqual(urlize('http:///www.google.com'), + u'http:///www.google.com') + self.assertEqual(urlize('http://.google.com'), + u'http://.google.com') + self.assertEqual(urlize('http://@foo.com'), + u'http://@foo.com') + def test_wordcount(self): self.assertEqual(wordcount(''), 0) self.assertEqual(wordcount(u'oneword'), 1) |
