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

Function test_bulk_create

tests/test_bulk.py:20–29  ·  view source on GitHub ↗

Test basic bulk create operation.

(db_truncate)

Source from the content-addressed store, hash-verified

18
19@pytest.mark.asyncio
20async def test_bulk_create(db_truncate):
21 """Test basic bulk create operation."""
22 await UniqueName.bulk_create([UniqueName() for _ in range(1000)])
23 all_ = await UniqueName.all().values("id", "name")
24 inc = all_[0]["id"]
25 assert_list_sort_equal(
26 all_,
27 [{"id": val + inc, "name": None} for val in range(1000)],
28 sorted_key="id",
29 )
30
31
32@requireCapability(dialect=NotEQ("mssql"))

Callers

nothing calls this directly

Calls 5

UniqueNameClass · 0.90
assert_list_sort_equalFunction · 0.85
bulk_createMethod · 0.45
valuesMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…