summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2012-11-24 00:44:48 +0200
committerAnssi Kääriäinen <akaariai@gmail.com>2012-11-24 01:20:22 +0200
commit421e599ad34b93e9537bf4deeca343f5b2e69f06 (patch)
treec9e817f3ed17e396864b652e41676d85fe86a92f /tests
parent625dc3f0722d80eaffacc39171ea7337ab089ae4 (diff)
[1.5.x] Fixed #19351 -- SQLite bulk_insert of more than 500 single-field objs
Backpatch of 0a0a0d66b316598f7c296e8bf75749a14ce3ac49
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/bulk_create/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/bulk_create/tests.py b/tests/regressiontests/bulk_create/tests.py
index 7cd74d1b47..d4772934a1 100644
--- a/tests/regressiontests/bulk_create/tests.py
+++ b/tests/regressiontests/bulk_create/tests.py
@@ -103,6 +103,14 @@ class BulkCreateTests(TestCase):
self.assertEqual(TwoFields.objects.filter(f2__gte=901).count(), 101)
@skipUnlessDBFeature('has_bulk_insert')
+ def test_large_single_field_batch(self):
+ # SQLite had a problem with more than 500 UNIONed selects in single
+ # query.
+ Restaurant.objects.bulk_create([
+ Restaurant() for i in range(0, 501)
+ ])
+
+ @skipUnlessDBFeature('has_bulk_insert')
def test_large_batch_efficiency(self):
with override_settings(DEBUG=True):
connection.queries = []