diff options
author | Jörg Breitbart <jerch@rockborn.de> | 2022-01-27 14:42:59 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-01-27 19:03:26 +0100 |
commit | 0af9a5fc7d765aa05ea784e2c3237675f3bb4b49 (patch) | |
tree | c4c9cffec53de12a61c7d59e62f86aef7bf8409a /tests/queries | |
parent | e972620ada4f9ed7bc57f28e133e85c85b0a7b20 (diff) | |
download | django-0af9a5fc7d765aa05ea784e2c3237675f3bb4b49.tar.gz |
Fixed #33463 -- Fixed QuerySet.bulk_update() with F() expressions.
Diffstat (limited to 'tests/queries')
-rw-r--r-- | tests/queries/test_bulk_update.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/queries/test_bulk_update.py b/tests/queries/test_bulk_update.py index 1d669e0bbd..b63046f9d2 100644 --- a/tests/queries/test_bulk_update.py +++ b/tests/queries/test_bulk_update.py @@ -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: |