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

Function test_update

tests/fields/test_decimal.py:54–60  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

52
53@pytest.mark.asyncio
54async def test_update(db):
55 obj0 = await testmodels.DecimalFields.create(decimal=Decimal("1.23456"), decimal_nodec=18.7)
56 await testmodels.DecimalFields.filter(id=obj0.id).update(decimal=Decimal("2.345"))
57 obj = await testmodels.DecimalFields.get(id=obj0.id)
58 assert obj.decimal == Decimal("2.345")
59 assert obj.decimal_nodec == 19
60 assert obj.decimal_null is None
61
62
63@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…