MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / test_update

Function test_update

tests/fields/test_json.py:76–82  ·  view source on GitHub ↗

Test JSON field update.

(db)

Source from the content-addressed store, hash-verified

74
75@pytest.mark.asyncio
76async def test_update(db):
77 """Test JSON field update."""
78 obj0 = await testmodels.JSONFields.create(data={"some": ["text", 3]})
79 await testmodels.JSONFields.filter(id=obj0.id).update(data={"other": ["text", 5]})
80 obj = await testmodels.JSONFields.get(id=obj0.id)
81 assert obj.data == {"other": ["text", 5]}
82 assert obj.data_null is None
83
84
85@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 4

updateMethod · 0.80
createMethod · 0.45
filterMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…