summaryrefslogtreecommitdiff
path: root/tests/queries
diff options
context:
space:
mode:
authorEbram Shehata <ebram96@gmail.com>2022-06-13 06:25:25 +0200
committerGitHub <noreply@github.com>2022-06-13 06:25:25 +0200
commit4996eaa7b5b11f822d1c97df79644738df3fed68 (patch)
tree2b21aae2d9d960966c0598a538785d0390a5be3b /tests/queries
parente96320c91724830034033a9cb8afd9cf8c11e2fd (diff)
downloaddjango-4996eaa7b5b11f822d1c97df79644738df3fed68.tar.gz
Made QuerySet.bulk_update() raise an error when batch_size is zero.
Diffstat (limited to 'tests/queries')
-rw-r--r--tests/queries/test_bulk_update.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/queries/test_bulk_update.py b/tests/queries/test_bulk_update.py
index bc252c21c6..b2688a61c8 100644
--- a/tests/queries/test_bulk_update.py
+++ b/tests/queries/test_bulk_update.py
@@ -125,6 +125,8 @@ class BulkUpdateTests(TestCase):
msg = "Batch size must be a positive integer."
with self.assertRaisesMessage(ValueError, msg):
Note.objects.bulk_update([], fields=["note"], batch_size=-1)
+ with self.assertRaisesMessage(ValueError, msg):
+ Note.objects.bulk_update([], fields=["note"], batch_size=0)
def test_nonexistent_field(self):
with self.assertRaisesMessage(