summaryrefslogtreecommitdiff
path: root/tests/validation
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-05-06 10:56:28 -0400
committerTim Graham <timograham@gmail.com>2018-03-20 12:10:10 -0400
commit5fa4f40f45fcdbb7e48489ed3039a314b5c961d0 (patch)
tree272b8798d2c2a054f56d8613a42453bce30f92c0 /tests/validation
parent73f7d1755ff1da3aac687c7b046e4b5028e505db (diff)
downloaddjango-5fa4f40f45fcdbb7e48489ed3039a314b5c961d0.tar.gz
Fixed #29227 -- Allowed BooleanField to be null=True.
Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
Diffstat (limited to 'tests/validation')
-rw-r--r--tests/validation/test_error_messages.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/validation/test_error_messages.py b/tests/validation/test_error_messages.py
index d2fc3e4939..0869d0fc10 100644
--- a/tests/validation/test_error_messages.py
+++ b/tests/validation/test_error_messages.py
@@ -23,6 +23,10 @@ class ValidationMessagesTest(TestCase):
f = models.BooleanField()
self._test_validation_messages(f, 'fõo', ["'fõo' value must be either True or False."])
+ def test_nullable_boolean_field_raises_error_message(self):
+ f = models.BooleanField(null=True)
+ self._test_validation_messages(f, 'fõo', ["'fõo' value must be either True, False, or None."])
+
def test_float_field_raises_error_message(self):
f = models.FloatField()
self._test_validation_messages(f, 'fõo', ["'fõo' value must be a float."])