MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / test_select_related

Function test_select_related

tests/test_queryset.py:740–746  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

738
739@pytest.mark.asyncio
740async def test_select_related(db):
741 tournament = await Tournament.create(name="1")
742 reporter = await Reporter.create(name="Reporter")
743 event = await Event.create(name="1", tournament=tournament, reporter=reporter)
744 event = await Event.all().select_related("tournament", "reporter").get(pk=event.pk)
745 assert event.tournament.pk == tournament.pk
746 assert event.reporter.pk == reporter.pk
747
748
749@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…