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

Function test_exists

tests/test_model_methods.py:347–356  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

345
346@pytest.mark.asyncio
347async def test_exists(db):
348 await Tournament.create(name="Test")
349 ret = await Tournament.exists(name="Test")
350 assert ret is True
351
352 ret = await Tournament.exists(name="XXX")
353 assert ret is False
354
355 ret = await Tournament.exists(Q(name="XXX") & Q(name="Test"))
356 assert ret is False
357
358
359@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

QClass · 0.90
createMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…