From b17c1d53fd7875dd0e3ffcffbfdeff348834b9b0 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 12 Jan 2018 18:44:36 -0500 Subject: [PATCH] Removed unused query log clearing in bulk_create tests. --- tests/bulk_create/tests.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py index 2439050623..b12ddcaeca 100644 --- a/tests/bulk_create/tests.py +++ b/tests/bulk_create/tests.py @@ -121,11 +121,9 @@ class BulkCreateTests(TestCase): self.assertEqual(Restaurant.objects.count(), 2) def test_large_batch(self): - with override_settings(DEBUG=True): - connection.queries_log.clear() - TwoFields.objects.bulk_create([ - TwoFields(f1=i, f2=i + 1) for i in range(0, 1001) - ]) + TwoFields.objects.bulk_create([ + TwoFields(f1=i, f2=i + 1) for i in range(0, 1001) + ]) self.assertEqual(TwoFields.objects.count(), 1001) self.assertEqual( TwoFields.objects.filter(f1__gte=450, f1__lte=550).count(), @@ -154,11 +152,10 @@ class BulkCreateTests(TestCase): Test inserting a large batch with objects having primary key set mixed together with objects without PK set. """ - with override_settings(DEBUG=True): - connection.queries_log.clear() - TwoFields.objects.bulk_create([ - TwoFields(id=i if i % 2 == 0 else None, f1=i, f2=i + 1) - for i in range(100000, 101000)]) + TwoFields.objects.bulk_create([ + TwoFields(id=i if i % 2 == 0 else None, f1=i, f2=i + 1) + for i in range(100000, 101000) + ]) self.assertEqual(TwoFields.objects.count(), 1000) # We can't assume much about the ID's created, except that the above # created IDs must exist.