mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #18724 -- Fixed IntegerField validation with value 0
This commit is contained in:
committed by
Claude Paroz
parent
9a3026a920
commit
ad237fb72f
@@ -274,6 +274,10 @@ class ValidationTest(test.TestCase):
|
||||
self.assertRaises(ValidationError, f.clean, None, None)
|
||||
self.assertRaises(ValidationError, f.clean, '', None)
|
||||
|
||||
def test_integerfield_validates_zero_against_choices(self):
|
||||
f = models.IntegerField(choices=((1, 1),))
|
||||
self.assertRaises(ValidationError, f.clean, '0', None)
|
||||
|
||||
def test_charfield_raises_error_on_empty_input(self):
|
||||
f = models.CharField(null=False)
|
||||
self.assertRaises(ValidationError, f.clean, None, None)
|
||||
|
||||
Reference in New Issue
Block a user