Improved test coverage of urlize.

This commit is contained in:
Sarah Boyce 2024-07-09 17:32:04 +02:00
parent d12184fedc
commit c6d1f98d26
1 changed files with 17 additions and 0 deletions

View File

@ -305,6 +305,23 @@ class FunctionTests(SimpleTestCase):
"http://testing.com/example</a>.,:;)&quot;!",
)
def test_trailing_semicolon(self):
self.assertEqual(
urlize("http://example.com?x=&amp;", autoescape=False),
'<a href="http://example.com?x=" rel="nofollow">'
"http://example.com?x=&amp;</a>",
)
self.assertEqual(
urlize("http://example.com?x=&amp;;", autoescape=False),
'<a href="http://example.com?x=" rel="nofollow">'
"http://example.com?x=&amp;</a>;",
)
self.assertEqual(
urlize("http://example.com?x=&amp;;;", autoescape=False),
'<a href="http://example.com?x=" rel="nofollow">'
"http://example.com?x=&amp;</a>;;",
)
def test_brackets(self):
"""
#19070 - Check urlize handles brackets properly