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

Function test_get

tests/test_model_methods.py:332–343  ·  view source on GitHub ↗
(tournament_model)

Source from the content-addressed store, hash-verified

330
331@pytest.mark.asyncio
332async def test_get(tournament_model):
333 mdl = tournament_model
334 fetched_mdl = await Tournament.get(name="Test")
335 assert mdl.id == fetched_mdl.id
336
337 with pytest.raises(DoesNotExist):
338 await Tournament.get(name="Test2")
339
340 await Tournament.create(name="Test")
341
342 with pytest.raises(MultipleObjectsReturned):
343 await Tournament.get(name="Test")
344
345
346@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…