mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #33463 -- Fixed QuerySet.bulk_update() with F() expressions.
This commit is contained in:
committed by
Mariusz Felisiak
parent
e972620ada
commit
0af9a5fc7d
@@ -211,6 +211,16 @@ class BulkUpdateTests(TestCase):
|
||||
Number.objects.bulk_update(numbers, ['num'])
|
||||
self.assertCountEqual(Number.objects.filter(num=1), numbers)
|
||||
|
||||
def test_f_expression(self):
|
||||
notes = [
|
||||
Note.objects.create(note='test_note', misc='test_misc')
|
||||
for _ in range(10)
|
||||
]
|
||||
for note in notes:
|
||||
note.misc = F('note')
|
||||
Note.objects.bulk_update(notes, ['misc'])
|
||||
self.assertCountEqual(Note.objects.filter(misc='test_note'), notes)
|
||||
|
||||
def test_booleanfield(self):
|
||||
individuals = [Individual.objects.create(alive=False) for _ in range(10)]
|
||||
for individual in individuals:
|
||||
|
||||
Reference in New Issue
Block a user