diff options
| author | Anoop Thomas Mathew <atmb4u@gmail.com> | 2015-04-15 00:12:49 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-04-17 18:08:33 -0400 |
| commit | 24003295088ec24d823f66bd5c8b917478b24c5d (patch) | |
| tree | a6c1d396b42ad2b55c1142f7a915ec82226bbf31 /tests/validators | |
| parent | b98dfc21770bb0ddc57ca34ddecf1576c2d9f176 (diff) | |
Fixed #24349 -- Limited domain name labels to 63 characters in EmailValidator
Diffstat (limited to 'tests/validators')
| -rw-r--r-- | tests/validators/tests.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/validators/tests.py b/tests/validators/tests.py index 4be4b9de4f..cf0ba908c2 100644 --- a/tests/validators/tests.py +++ b/tests/validators/tests.py @@ -45,7 +45,12 @@ TEST_DATA = [ (validate_email, 'email@localhost', None), (EmailValidator(whitelist=['localdomain']), 'email@localdomain', None), (validate_email, '"test@test"@example.com', None), + (validate_email, 'example@atm.%s' % ('a' * 63), None), + (validate_email, 'example@%s.atm' % ('a' * 63), None), + (validate_email, 'example@%s.%s.atm' % ('a' * 63, 'b' * 10), None), + (validate_email, 'example@atm.%s' % ('a' * 64), ValidationError), + (validate_email, 'example@%s.atm.%s' % ('b' * 64, 'a' * 63), ValidationError), (validate_email, None, ValidationError), (validate_email, '', ValidationError), (validate_email, 'abc', ValidationError), @@ -69,9 +74,9 @@ TEST_DATA = [ (validate_email, '"\\\011"@here.com', None), (validate_email, '"\\\012"@here.com', ValidationError), (validate_email, 'trailingdot@shouldfail.com.', ValidationError), - # Max length of domain name in email is 249 (see validator for calculation) - (validate_email, 'a@%s.us' % ('a' * 249), None), - (validate_email, 'a@%s.us' % ('a' * 250), ValidationError), + # Max length of domain name labels is 63 characters per RFC 1034. + (validate_email, 'a@%s.us' % ('a' * 63), None), + (validate_email, 'a@%s.us' % ('a' * 64), ValidationError), (validate_slug, 'slug-ok', None), (validate_slug, 'longer-slug-still-ok', None), |
