mirror of
https://github.com/django/django.git
synced 2025-11-23 04:25:55 +00:00
Fixed #34558 -- Fixed QuerySet.bulk_create() crash with Now() on Oracle.
This commit is contained in:
parent
2b11740e1d
commit
72a86ceb33
4 changed files with 32 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ from django.db import (
|
|||
connection,
|
||||
)
|
||||
from django.db.models import FileField, Value
|
||||
from django.db.models.functions import Lower
|
||||
from django.db.models.functions import Lower, Now
|
||||
from django.test import (
|
||||
TestCase,
|
||||
override_settings,
|
||||
|
|
@ -300,6 +300,19 @@ class BulkCreateTests(TestCase):
|
|||
bbb = Restaurant.objects.filter(name="betty's beetroot bar")
|
||||
self.assertEqual(bbb.count(), 1)
|
||||
|
||||
@skipUnlessDBFeature("has_bulk_insert")
|
||||
def test_bulk_insert_now(self):
|
||||
NullableFields.objects.bulk_create(
|
||||
[
|
||||
NullableFields(datetime_field=Now()),
|
||||
NullableFields(datetime_field=Now()),
|
||||
]
|
||||
)
|
||||
self.assertEqual(
|
||||
NullableFields.objects.filter(datetime_field__isnull=False).count(),
|
||||
2,
|
||||
)
|
||||
|
||||
@skipUnlessDBFeature("has_bulk_insert")
|
||||
def test_bulk_insert_nullable_fields(self):
|
||||
fk_to_auto_fields = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue