mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Fixed #18724 -- Fixed IntegerField validation with value 0
This commit is contained in:
parent
9a3026a920
commit
ad237fb72f
2 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue