mirror of
https://github.com/django/django.git
synced 2025-06-29 07:19:11 +00:00
[5.2.x] Refs #35167 -- Fixed test_bulk_update_custom_get_prep_value() crash on databases that don't support primitives in JSONFields.
For example on Oracle < 21c. Backport of 7500044a825b3e6695f4f0f9e56d5bdc0c5d7988 from main.
This commit is contained in:
parent
463e87e249
commit
43aa6990ac
@ -438,7 +438,10 @@ class CustomSerializationJSONModel(models.Model):
|
||||
json_field = StringifiedJSONField()
|
||||
|
||||
class Meta:
|
||||
required_db_features = {"supports_json_field"}
|
||||
required_db_features = {
|
||||
"supports_json_field",
|
||||
"supports_primitives_in_json_field",
|
||||
}
|
||||
|
||||
|
||||
class AllFieldsModel(models.Model):
|
||||
|
@ -304,6 +304,7 @@ class TestSaveLoad(TestCase):
|
||||
obj.refresh_from_db()
|
||||
self.assertEqual(obj.value, value)
|
||||
|
||||
@skipUnlessDBFeature("supports_primitives_in_json_field")
|
||||
def test_bulk_update_custom_get_prep_value(self):
|
||||
objs = CustomSerializationJSONModel.objects.bulk_create(
|
||||
[CustomSerializationJSONModel(pk=1, json_field={"version": "1"})]
|
||||
|
Loading…
x
Reference in New Issue
Block a user