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

Function test__remove

tests/fields/test_m2m_uuid.py:102–111  ·  view source on GitHub ↗
(db, m2m_uuid_models)

Source from the content-addressed store, hash-verified

100
101@pytest.mark.asyncio
102async def test__remove(db, m2m_uuid_models):
103 UUIDPkModel, UUIDM2MRelatedModel = m2m_uuid_models
104 one = await UUIDPkModel.create()
105 two1 = await UUIDM2MRelatedModel.create()
106 two2 = await UUIDM2MRelatedModel.create()
107 await one.peers.add(two1, two2)
108 await one.peers.remove(two1)
109 assert await one.peers == [two2]
110 assert await two1.models == []
111 assert await two2.models == [one]
112
113
114@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

addMethod · 0.80
removeMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…