1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Refs #36088, Refs #36260 - Added supports_expression_defaults checks in bulk_create() tests.

This commit is contained in:
Tim Graham
2025-04-05 12:47:53 -04:00
committed by GitHub
parent 764af7a3d6
commit 02e7a162a0
2 changed files with 10 additions and 1 deletions

View File

@@ -845,6 +845,7 @@ class BulkCreateTests(TestCase):
],
)
@skipUnlessDBFeature("supports_expression_defaults")
def test_db_default_field_excluded(self):
# created_at is excluded when no db_default override is provided.
with self.assertNumQueries(1) as ctx:
@@ -869,7 +870,9 @@ class BulkCreateTests(TestCase):
2 if connection.features.can_return_rows_from_bulk_insert else 1,
)
@skipUnlessDBFeature("can_return_rows_from_bulk_insert")
@skipUnlessDBFeature(
"can_return_rows_from_bulk_insert", "supports_expression_defaults"
)
def test_db_default_primary_key(self):
(obj,) = DbDefaultPrimaryKey.objects.bulk_create([DbDefaultPrimaryKey()])
self.assertIsInstance(obj.id, datetime)