Fixed #29227 -- Allowed BooleanField to be null=True.

Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
This commit is contained in:
Tim Graham 2017-05-06 10:56:28 -04:00
parent 73f7d1755f
commit 5fa4f40f45
32 changed files with 158 additions and 98 deletions

View file

@ -50,7 +50,7 @@ class Tests(unittest.TestCase):
def test_boolean_constraints(self):
"""Boolean fields have check constraints on their values."""
for field in (BooleanField(), NullBooleanField()):
for field in (BooleanField(), NullBooleanField(), BooleanField(null=True)):
with self.subTest(field=field):
field.set_attributes_from_name('is_nice')
self.assertIn('"IS_NICE" IN (0,1)', field.db_check(connection))