mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Fixed incorrect integer division in DeletionTests.test_large_delete_related.
This commit is contained in:
parent
d896809a3a
commit
3fb1ad9505
@ -342,12 +342,12 @@ class DeletionTests(TestCase):
|
||||
|
||||
batch_size = max(connection.ops.bulk_batch_size(['pk'], range(TEST_SIZE)), 1)
|
||||
|
||||
# TEST_SIZE // batch_size (select related `T` instances)
|
||||
# TEST_SIZE / batch_size (select related `T` instances)
|
||||
# + 1 (select related `U` instances)
|
||||
# + TEST_SIZE // GET_ITERATOR_CHUNK_SIZE (delete `T` instances in batches)
|
||||
# + TEST_SIZE / GET_ITERATOR_CHUNK_SIZE (delete `T` instances in batches)
|
||||
# + 1 (delete `s`)
|
||||
expected_num_queries = (ceil(TEST_SIZE // batch_size) +
|
||||
ceil(TEST_SIZE // GET_ITERATOR_CHUNK_SIZE) + 2)
|
||||
expected_num_queries = ceil(TEST_SIZE / batch_size)
|
||||
expected_num_queries += ceil(TEST_SIZE / GET_ITERATOR_CHUNK_SIZE) + 2
|
||||
|
||||
self.assertNumQueries(expected_num_queries, s.delete)
|
||||
self.assertFalse(S.objects.exists())
|
||||
|
Loading…
Reference in New Issue
Block a user