diff options
| author | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-07-09 17:32:04 +0200 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-07-10 09:32:02 +0200 |
| commit | c6d1f98d2685f34e009e0fffdcff4ad275e55879 (patch) | |
| tree | a0fa60909c4e7e3e45e2a1490d50bb3a80edf9fc | |
| parent | d12184fedcd586e2c399ea40abe4bf865ebc87a6 (diff) | |
Improved test coverage of urlize.
| -rw-r--r-- | tests/template_tests/filter_tests/test_urlize.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/template_tests/filter_tests/test_urlize.py b/tests/template_tests/filter_tests/test_urlize.py index 8f84e62c92..c19103859e 100644 --- a/tests/template_tests/filter_tests/test_urlize.py +++ b/tests/template_tests/filter_tests/test_urlize.py @@ -305,6 +305,23 @@ class FunctionTests(SimpleTestCase): "http://testing.com/example</a>.,:;)"!", ) + def test_trailing_semicolon(self): + self.assertEqual( + urlize("http://example.com?x=&", autoescape=False), + '<a href="http://example.com?x=" rel="nofollow">' + "http://example.com?x=&</a>", + ) + self.assertEqual( + urlize("http://example.com?x=&;", autoescape=False), + '<a href="http://example.com?x=" rel="nofollow">' + "http://example.com?x=&</a>;", + ) + self.assertEqual( + urlize("http://example.com?x=&;;", autoescape=False), + '<a href="http://example.com?x=" rel="nofollow">' + "http://example.com?x=&</a>;;", + ) + def test_brackets(self): """ #19070 - Check urlize handles brackets properly |
