mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
Fixed test with correct length of the long_email
This commit is contained in:
parent
1954d718cb
commit
6dc451195e
@ -64,12 +64,12 @@ class EmailFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
|
|||||||
"'Ensure this value has at most 15 characters (it has 20).'",
|
"'Ensure this value has at most 15 characters (it has 20).'",
|
||||||
):
|
):
|
||||||
f.clean("alf123456788@foo.com")
|
f.clean("alf123456788@foo.com")
|
||||||
email = 'a' * 245 + '@example.com' # This email has 255 characters
|
long_email = 'a' * 245 + '@example.com'
|
||||||
with self.assertRaisesMessage(
|
with self.assertRaisesMessage(
|
||||||
ValidationError,
|
ValidationError,
|
||||||
"'Ensure this value has at most 15 characters (it has 255).'"
|
"'Ensure this value has at most 15 characters (it has 257).'"
|
||||||
):
|
):
|
||||||
f.clean(email)
|
f.clean(long_email)
|
||||||
|
|
||||||
def test_emailfield_strip_on_none_value(self):
|
def test_emailfield_strip_on_none_value(self):
|
||||||
f = EmailField(required=False, empty_value=None)
|
f = EmailField(required=False, empty_value=None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user