1
0
mirror of https://github.com/django/django.git synced 2025-01-03 06:55:47 +00:00

Refs #34434 -- Added assertion for cleaning 0-0-0 for forms.DateField.

This commit is contained in:
Jure Slak 2023-03-22 07:48:15 +01:00 committed by Mariusz Felisiak
parent 02c356f2f3
commit b4870e7196

View File

@ -149,6 +149,8 @@ class DateFieldTest(SimpleTestCase):
f.clean("200a-10-25") f.clean("200a-10-25")
with self.assertRaisesMessage(ValidationError, "'Enter a valid date.'"): with self.assertRaisesMessage(ValidationError, "'Enter a valid date.'"):
f.clean("25/10/06") f.clean("25/10/06")
with self.assertRaisesMessage(ValidationError, "'Enter a valid date.'"):
f.clean("0-0-0")
with self.assertRaisesMessage(ValidationError, "'This field is required.'"): with self.assertRaisesMessage(ValidationError, "'This field is required.'"):
f.clean(None) f.clean(None)