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

Function test_basic_oldstyle

tests/test_basic.py:30–36  ·  view source on GitHub ↗

Test OldStyleModel with external_id field.

(db)

Source from the content-addressed store, hash-verified

28
29@pytest.mark.asyncio
30async def test_basic_oldstyle(db):
31 """Test OldStyleModel with external_id field."""
32 obj = await OldStyleModel.create(external_id=123)
33 assert obj.pk
34
35 assert OldStyleModel._meta.fields_map["id"].pk
36 assert OldStyleModel._meta.fields_map["external_id"].index

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…