diff options
| author | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-07-09 17:32:04 +0200 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2024-08-26 13:16:05 -0300 |
| commit | c9a8d005ee4a9618949cf95408ad6e9ca6817ea6 (patch) | |
| tree | d9dd24b4117f925159d8664adcca37a4abd19815 | |
| parent | 7acec02554f3e254bee3c1ea65ed27c3c145ad68 (diff) | |
[5.1.x] Improved test coverage of urlize.
Backport of c6d1f98d2685f34e009e0fffdcff4ad275e55879 from main.
| -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 |
