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:
@@ -820,6 +820,19 @@ class CaseExpressionTests(TestCase):
|
||||
transform=attrgetter('integer', 'null_boolean')
|
||||
)
|
||||
|
||||
def test_update_null_boolean_old(self):
|
||||
CaseTestModel.objects.update(
|
||||
null_boolean_old=Case(
|
||||
When(integer=1, then=True),
|
||||
When(integer=2, then=False),
|
||||
),
|
||||
)
|
||||
self.assertQuerysetEqual(
|
||||
CaseTestModel.objects.all().order_by('pk'),
|
||||
[(1, True), (2, False), (3, None), (2, False), (3, None), (3, None), (4, None)],
|
||||
transform=attrgetter('integer', 'null_boolean_old')
|
||||
)
|
||||
|
||||
def test_update_positive_integer(self):
|
||||
CaseTestModel.objects.update(
|
||||
positive_integer=Case(
|
||||
|
||||
Reference in New Issue
Block a user