summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2025-02-25 12:23:13 -0500
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-02-27 09:42:08 +0100
commit77666f2fa1ef93f7b7728a565260229918d51532 (patch)
tree69dcb16b9cb9bcdf9c00ba0c4395ad3d93662d25 /tests
parent5a1cae3a5675c5733daf5949759476d65aa0e636 (diff)
Refs #35617 -- Removed hardcoded pk in test_bulk_update_custom_get_prep_value().
Diffstat (limited to 'tests')
-rw-r--r--tests/model_fields/test_jsonfield.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/model_fields/test_jsonfield.py b/tests/model_fields/test_jsonfield.py
index 3fd68477e1..1788933774 100644
--- a/tests/model_fields/test_jsonfield.py
+++ b/tests/model_fields/test_jsonfield.py
@@ -306,11 +306,9 @@ class TestSaveLoad(TestCase):
@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"})]
- )
- objs[0].json_field["version"] = "1-alpha"
- CustomSerializationJSONModel.objects.bulk_update(objs, ["json_field"])
+ obj = CustomSerializationJSONModel.objects.create(json_field={"version": "1"})
+ obj.json_field["version"] = "1-alpha"
+ CustomSerializationJSONModel.objects.bulk_update([obj], ["json_field"])
self.assertSequenceEqual(
CustomSerializationJSONModel.objects.values("json_field"),
[{"json_field": '{"version": "1-alpha"}'}],