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

Function test_create

tests/fields/test_float.py:17–25  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

15
16@pytest.mark.asyncio
17async def test_create(db):
18 obj0 = await testmodels.FloatFields.create(floatnum=1.23)
19 obj = await testmodels.FloatFields.get(id=obj0.id)
20 assert obj.floatnum == 1.23
21 assert Decimal(obj.floatnum) != Decimal("1.23")
22 assert obj.floatnum_null is None
23 await obj.save()
24 obj2 = await testmodels.FloatFields.get(id=obj.id)
25 assert obj == obj2
26
27
28@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

saveMethod · 0.80
createMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…