diff options
| author | Brendan MacDonell <brendan@macdonell.net> | 2012-08-06 10:42:21 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-06 10:42:21 +0200 |
| commit | ad237fb72f769bbd99b5ed6e3292bead614e1c94 (patch) | |
| tree | 87846e67a25363fe866a261726467ca774c694d7 /tests | |
| parent | 9a3026a920286e9932401300d14f72a85ba03a43 (diff) | |
Fixed #18724 -- Fixed IntegerField validation with value 0
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/model_fields/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py index e86159463d..7d6071accc 100644 --- a/tests/regressiontests/model_fields/tests.py +++ b/tests/regressiontests/model_fields/tests.py @@ -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) |
