support(bulk-create): add raise_error flag when bulk-create empty models (#853)
* add raise_error flag when bulk-create empty models * if not raise_error, return * fix ut cov * raise exception when it's empty
This commit is contained in:
@ -286,6 +286,9 @@ async def test_bulk_create():
|
||||
completed = await ToDo.objects.filter(completed=True).all()
|
||||
assert len(completed) == 2
|
||||
|
||||
with pytest.raises(ormar.exceptions.ModelListEmptyError):
|
||||
await ToDo.objects.bulk_create([])
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bulk_create_json_field():
|
||||
|
||||
Reference in New Issue
Block a user