summaryrefslogtreecommitdiff
path: root/tests/bulk_create/tests.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-10-08 21:14:24 -0400
committerTim Graham <timograham@gmail.com>2015-10-09 14:42:31 -0400
commit7cd299584dd9b152c736854c6558670e57512d40 (patch)
treea21f842edb5b57727831ef7d7aeecb65b4d461a0 /tests/bulk_create/tests.py
parentf717cb2ab4accd9e808449bb0a59b6c5b35059f1 (diff)
[1.9.x] Fixed #22705 -- Fixed QuerySet.bulk_create() on models without any fields on Oracle.
Fixed on other backends by 134ca4d438bd7cbe8f0f287a00d545f96fa04a01. Thanks Mariusz Felisiak for the solution. Backport of 7a5b7e35bf2e219225b9f26d3dd3e34f26e83e9c from master
Diffstat (limited to 'tests/bulk_create/tests.py')
-rw-r--r--tests/bulk_create/tests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py
index ce069504d0..f881a1dba0 100644
--- a/tests/bulk_create/tests.py
+++ b/tests/bulk_create/tests.py
@@ -10,8 +10,8 @@ from django.test import (
)
from .models import (
- Country, Pizzeria, ProxyCountry, ProxyMultiCountry, ProxyMultiProxyCountry,
- ProxyProxyCountry, Restaurant, State, TwoFields,
+ Country, NoFields, Pizzeria, ProxyCountry, ProxyMultiCountry,
+ ProxyMultiProxyCountry, ProxyProxyCountry, Restaurant, State, TwoFields,
)
@@ -177,6 +177,10 @@ class BulkCreateTests(TestCase):
TwoFields.objects.bulk_create(objs, len(objs))
self.assertEqual(TwoFields.objects.count(), len(objs))
+ def test_empty_model(self):
+ NoFields.objects.bulk_create([NoFields() for i in range(2)])
+ self.assertEqual(NoFields.objects.count(), 2)
+
@skipUnlessDBFeature('has_bulk_insert')
def test_explicit_batch_size_efficiency(self):
objs = [TwoFields(f1=i, f2=i) for i in range(0, 100)]