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

Function test_delete

tests/test_queryset.py:449–463  ·  view source on GitHub ↗
(db, intfields_data)

Source from the content-addressed store, hash-verified

447
448@pytest.mark.asyncio
449async def test_delete(db, intfields_data):
450 # Test delete
451 await (await IntFields.get(intnum=40)).delete()
452
453 with pytest.raises(DoesNotExist):
454 await IntFields.get(intnum=40)
455
456 assert await IntFields.all().count() == 29
457
458 rows_affected = (
459 await IntFields.all().order_by("intnum").limit(10).filter(intnum__gte=70).delete()
460 )
461 assert rows_affected == 10
462
463 assert await IntFields.all().count() == 19
464
465
466@requireCapability(support_update_limit_order_by=True)

Callers

nothing calls this directly

Calls 7

countMethod · 0.80
deleteMethod · 0.45
getMethod · 0.45
allMethod · 0.45
filterMethod · 0.45
limitMethod · 0.45
order_byMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…