mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #22705 -- Fixed QuerySet.bulk_create() on models without any fields on Oracle.
Fixed on other backends by 134ca4d438.
Thanks Mariusz Felisiak for the solution.
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user