Fixed incorrect integer division in DeletionTests.test_large_delete_related.

This commit is contained in:
Mariusz Felisiak 2017-10-02 16:11:20 +02:00 committed by Tim Graham
parent d896809a3a
commit 3fb1ad9505
1 changed files with 4 additions and 4 deletions

View File

@ -342,12 +342,12 @@ class DeletionTests(TestCase):
batch_size = max(connection.ops.bulk_batch_size(['pk'], range(TEST_SIZE)), 1) 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) # + 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`) # + 1 (delete `s`)
expected_num_queries = (ceil(TEST_SIZE // batch_size) + expected_num_queries = ceil(TEST_SIZE / batch_size)
ceil(TEST_SIZE // GET_ITERATOR_CHUNK_SIZE) + 2) expected_num_queries += ceil(TEST_SIZE / GET_ITERATOR_CHUNK_SIZE) + 2
self.assertNumQueries(expected_num_queries, s.delete) self.assertNumQueries(expected_num_queries, s.delete)
self.assertFalse(S.objects.exists()) self.assertFalse(S.objects.exists())