diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-08 19:42:14 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-01-08 19:42:14 +0000 |
| commit | 15d10a5210378bba88c7dfa1f45a4d3528ddfc3f (patch) | |
| tree | 1c6ea78522f302b6bb7792d0ac54f6605c36e6de /tests | |
| parent | 78c92c416790b22eb837dbf852f93134e354173d (diff) | |
Fixed #11911 -- Made the urlize filter smarter with closing punctuation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17362 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 d79965fee1..00807b0360 100644 --- a/tests/regressiontests/defaultfilters/tests.py +++ b/tests/regressiontests/defaultfilters/tests.py @@ -253,6 +253,14 @@ class DefaultFiltersTests(TestCase): u'<a href="http://en.wikipedia.org/wiki/Caf%C3%A9" rel="nofollow">' u'http://en.wikipedia.org/wiki/Café</a>') + # Check urlize keeps balanced parentheses - see #11911 + self.assertEqual(urlize('http://en.wikipedia.org/wiki/Django_(web_framework)'), + u'<a href="http://en.wikipedia.org/wiki/Django_(web_framework)" rel="nofollow">' + u'http://en.wikipedia.org/wiki/Django_(web_framework)</a>') + self.assertEqual(urlize('(see http://en.wikipedia.org/wiki/Django_(web_framework))'), + u'(see <a href="http://en.wikipedia.org/wiki/Django_(web_framework)" rel="nofollow">' + u'http://en.wikipedia.org/wiki/Django_(web_framework)</a>)') + # Check urlize adds nofollow properly - see #12183 self.assertEqual(urlize('foo@bar.com or www.bar.com'), u'<a href="mailto:foo@bar.com">foo@bar.com</a> or ' |
