diff options
| author | Tim Graham <timograham@gmail.com> | 2018-02-27 11:00:47 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-03-06 08:30:41 -0500 |
| commit | 911af0d24b8aa83595eecdc5eacfac3fba4ffc9b (patch) | |
| tree | a049261c29e1f6b0a3d8cb10841a8ec2a7a15413 /tests/utils_tests | |
| parent | 97b7dd59bb8d6163239061e2022153c3415d146d (diff) | |
Added more tests for django.utils.html.urlize().
Diffstat (limited to 'tests/utils_tests')
| -rw-r--r-- | tests/utils_tests/test_html.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py index cce29c3fcd..005f4c79b5 100644 --- a/tests/utils_tests/test_html.py +++ b/tests/utils_tests/test_html.py @@ -249,6 +249,7 @@ class TestUtilsHtml(SimpleTestCase): lazystr('Search for google.com/?q=!'), 'Search for <a href="http://google.com/?q=">google.com/?q=</a>!' ), + ('foo@example.com', '<a href="mailto:foo@example.com">foo@example.com</a>'), ) for value, output in tests: with self.subTest(value=value): @@ -258,6 +259,11 @@ class TestUtilsHtml(SimpleTestCase): tests = ( ('a' + '@a' * 50000) + 'a', # simple_email_re catastrophic test ('a' + '.' * 1000000) + 'a', # trailing_punctuation catastrophic test + 'foo@', + '@foo.com', + 'foo@.example.com', + 'foo@localhost', + 'foo@localhost.', ) for value in tests: with self.subTest(value=value): |
