diff options
| author | Justin Thurman <justin.thurman@bevy.com> | 2024-10-16 09:43:02 -0400 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-10-17 16:45:44 +0200 |
| commit | 99dcc59237f384d7ade98acfd1cae8d90e6d60ab (patch) | |
| tree | c738f80bbea3f6487104cd296feb45e9d57cd502 /tests/validators | |
| parent | 65f3cfce59395131f318cf1ecba144530ed6609e (diff) | |
Fixed #35845 -- Updated DomainNameValidator to require entire string to be a valid domain name.
Bug in 4971a9afe5642569f3dcfcd3972ebb39e88dd457.
Thank you to kazet for the report and Claude Paroz for the review.
Diffstat (limited to 'tests/validators')
| -rw-r--r-- | tests/validators/tests.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/validators/tests.py b/tests/validators/tests.py index ba1db5ea46..4ae0f6413e 100644 --- a/tests/validators/tests.py +++ b/tests/validators/tests.py @@ -635,8 +635,8 @@ TEST_DATA = [ (validate_domain_name, "python-python.com", None), (validate_domain_name, "python.name.uk", None), (validate_domain_name, "python.tips", None), - (validate_domain_name, "http://例子.测试", None), - (validate_domain_name, "http://dashinpunytld.xn---c", None), + (validate_domain_name, "例子.测试", None), + (validate_domain_name, "dashinpunytld.xn---c", None), (validate_domain_name, "python..org", ValidationError), (validate_domain_name, "python-.org", ValidationError), (validate_domain_name, "too-long-name." * 20 + "com", ValidationError), @@ -652,6 +652,16 @@ TEST_DATA = [ ), (DomainNameValidator(accept_idna=False), "ıçğü.com", ValidationError), (DomainNameValidator(accept_idna=False), "not-domain-name", ValidationError), + ( + DomainNameValidator(accept_idna=False), + "not-domain-name, but-has-domain-name-suffix.com", + ValidationError, + ), + ( + DomainNameValidator(accept_idna=False), + "not-domain-name.com, but has domain prefix", + ValidationError, + ), ] # Add valid and invalid URL tests. |
