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

Function test_create

tests/fields/test_array.py:18–26  ·  view source on GitHub ↗

Test array field creation and retrieval.

(db_array_fields)

Source from the content-addressed store, hash-verified

16@requireCapability(dialect="postgres")
17@pytest.mark.asyncio
18async def test_create(db_array_fields):
19 """Test array field creation and retrieval."""
20 obj0 = await testmodels.ArrayFields.create(array=[0])
21 obj = await testmodels.ArrayFields.get(id=obj0.id)
22 assert obj.array == [0]
23 assert obj.array_null is None
24 await obj.save()
25 obj2 = await testmodels.ArrayFields.get(id=obj.id)
26 assert obj == obj2
27
28
29@requireCapability(dialect="postgres")

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…