From cfcca7ccce3dc527d16757ff6dc978e50c4a2e61 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 7 Jun 2014 14:09:27 +0200 Subject: Fixed #3711, #6734, #12581 -- Bounded connection.queries. Prevented unlimited memory consumption when running background tasks with DEBUG=True. Thanks Rob, Alex, Baptiste, and others. --- tests/bulk_create/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/bulk_create') diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py index 8648184223..f49fe4e54e 100644 --- a/tests/bulk_create/tests.py +++ b/tests/bulk_create/tests.py @@ -91,7 +91,7 @@ class BulkCreateTests(TestCase): def test_large_batch(self): with override_settings(DEBUG=True): - connection.queries = [] + connection.queries_log.clear() TwoFields.objects.bulk_create([ TwoFields(f1=i, f2=i + 1) for i in range(0, 1001) ]) @@ -112,7 +112,7 @@ class BulkCreateTests(TestCase): @skipUnlessDBFeature('has_bulk_insert') def test_large_batch_efficiency(self): with override_settings(DEBUG=True): - connection.queries = [] + connection.queries_log.clear() TwoFields.objects.bulk_create([ TwoFields(f1=i, f2=i + 1) for i in range(0, 1001) ]) @@ -124,7 +124,7 @@ class BulkCreateTests(TestCase): mixed together with objects without PK set. """ with override_settings(DEBUG=True): - connection.queries = [] + 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)]) @@ -142,7 +142,7 @@ class BulkCreateTests(TestCase): mixed together with objects without PK set. """ with override_settings(DEBUG=True): - connection.queries = [] + 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)]) -- cgit v1.3