diff --git a/tests/validators/tests.py b/tests/validators/tests.py index 5376517a4a..9e1187dc89 100644 --- a/tests/validators/tests.py +++ b/tests/validators/tests.py @@ -323,6 +323,9 @@ TEST_DATA = [ # 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), + # validation error if max length of email exceeds 254 chracters. + (validate_email, "%s@example.com" % ("a" * 50), None), + (validate_email, "%s@example.com" % ("a" * 250), ValidationError), # Trailing newlines in username or domain not allowed (validate_email, "a@b.com\n", ValidationError), (validate_email, "a\n@b.com", ValidationError),