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

Function test_update_relation

tests/test_update.py:169–176  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

167
168@pytest.mark.asyncio
169async def test_update_relation(db):
170 tournament_first = await Tournament.create(name="1")
171 tournament_second = await Tournament.create(name="2")
172
173 await Event.create(name="1", tournament=tournament_first)
174 await Event.all().update(tournament=tournament_second)
175 event = await Event.first()
176 assert event.tournament_id == tournament_second.id
177
178
179@requireCapability(dialect=In("mysql", "sqlite"))

Callers

nothing calls this directly

Calls 4

updateMethod · 0.80
createMethod · 0.45
allMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…