mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
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:
@@ -38,24 +38,6 @@ class AutoFieldTests(SimpleTestCase):
|
||||
])
|
||||
|
||||
|
||||
@isolate_apps('invalid_models_tests')
|
||||
class BooleanFieldTests(SimpleTestCase):
|
||||
|
||||
def test_nullable_boolean_field(self):
|
||||
class Model(models.Model):
|
||||
field = models.BooleanField(null=True)
|
||||
|
||||
field = Model._meta.get_field('field')
|
||||
self.assertEqual(field.check(), [
|
||||
Error(
|
||||
'BooleanFields do not accept null values.',
|
||||
hint='Use a NullBooleanField instead.',
|
||||
obj=field,
|
||||
id='fields.E110',
|
||||
),
|
||||
])
|
||||
|
||||
|
||||
@isolate_apps('invalid_models_tests')
|
||||
class CharFieldTests(TestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user