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

Function test_create

tests/fields/test_binary.py:15–22  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

13
14@pytest.mark.asyncio
15async def test_create(db):
16 obj0 = await testmodels.BinaryFields.create(binary=bytes(range(256)) * 500)
17 obj = await testmodels.BinaryFields.get(id=obj0.id)
18 assert obj.binary == bytes(range(256)) * 500
19 assert obj.binary_null is None
20 await obj.save()
21 obj2 = await testmodels.BinaryFields.get(id=obj.id)
22 assert obj == obj2
23
24
25@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…