MCPcopy
hub / github.com/tortoise/tortoise-orm / test_basic

Function test_basic

tests/test_inheritance.py:7–17  ·  view source on GitHub ↗

Test basic model inheritance with abstract base model.

(db)

Source from the content-addressed store, hash-verified

5
6@pytest.mark.asyncio
7async def test_basic(db):
8 """Test basic model inheritance with abstract base model."""
9 model = MyDerivedModel(name="test")
10 assert hasattr(MyAbstractBaseModel(), "name")
11 assert hasattr(model, "created_at")
12 assert hasattr(model, "modified_at")
13 assert hasattr(model, "name")
14 assert hasattr(model, "first_name")
15 await model.save()
16 assert model.created_at is not None
17 assert model.modified_at is not None

Callers

nothing calls this directly

Calls 3

MyDerivedModelClass · 0.90
MyAbstractBaseModelClass · 0.90
saveMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…