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

Function test_delete

tests/test_sql.py:199–211  ·  view source on GitHub ↗
(sql_context)

Source from the content-addressed store, hash-verified

197
198
199def test_delete(sql_context):
200 db, dialect, is_psycopg = sql_context
201 sql = IntFields.filter(intnum=2).delete().sql()
202 if dialect == "mysql":
203 expected = "DELETE FROM `intfields` WHERE `intnum`=%s"
204 elif dialect == "postgres":
205 if is_psycopg:
206 expected = 'DELETE FROM "intfields" WHERE "intnum"=%s'
207 else:
208 expected = 'DELETE FROM "intfields" WHERE "intnum"=$1'
209 else:
210 expected = 'DELETE FROM "intfields" WHERE "intnum"=?'
211 assert sql == expected
212
213
214@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

sqlMethod · 0.45
deleteMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…