Unverified Kaydet (Commit) b17c1d53 authored tarafından Tim Graham's avatar Tim Graham Kaydeden (comit) GitHub

Removed unused query log clearing in bulk_create tests.

üst b9cec9fa
...@@ -121,8 +121,6 @@ class BulkCreateTests(TestCase): ...@@ -121,8 +121,6 @@ class BulkCreateTests(TestCase):
self.assertEqual(Restaurant.objects.count(), 2) self.assertEqual(Restaurant.objects.count(), 2)
def test_large_batch(self): def test_large_batch(self):
with override_settings(DEBUG=True):
connection.queries_log.clear()
TwoFields.objects.bulk_create([ TwoFields.objects.bulk_create([
TwoFields(f1=i, f2=i + 1) for i in range(0, 1001) TwoFields(f1=i, f2=i + 1) for i in range(0, 1001)
]) ])
...@@ -154,11 +152,10 @@ class BulkCreateTests(TestCase): ...@@ -154,11 +152,10 @@ class BulkCreateTests(TestCase):
Test inserting a large batch with objects having primary key set Test inserting a large batch with objects having primary key set
mixed together with objects without PK set. mixed together with objects without PK set.
""" """
with override_settings(DEBUG=True):
connection.queries_log.clear()
TwoFields.objects.bulk_create([ TwoFields.objects.bulk_create([
TwoFields(id=i if i % 2 == 0 else None, f1=i, f2=i + 1) TwoFields(id=i if i % 2 == 0 else None, f1=i, f2=i + 1)
for i in range(100000, 101000)]) for i in range(100000, 101000)
])
self.assertEqual(TwoFields.objects.count(), 1000) self.assertEqual(TwoFields.objects.count(), 1000)
# We can't assume much about the ID's created, except that the above # We can't assume much about the ID's created, except that the above
# created IDs must exist. # created IDs must exist.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment