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

Function test_db_constraint

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

Source from the content-addressed store, hash-verified

345
346@pytest.mark.asyncio
347async def test_db_constraint(db):
348 author = await Author.create(name="Some One")
349 book = await BookNoConstraint.create(name="First!", author=author, rating=4)
350 book = await BookNoConstraint.all().select_related("author").get(pk=book.pk)
351 assert author.pk == book.author.pk
352
353
354@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 4

createMethod · 0.45
getMethod · 0.45
select_relatedMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…