Coverage for databases/tests/test_delete_many.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2024-08-27 18:25 +0000

1import pytest 

2 

3from prisma import Prisma 

4 

5# TODO: more tests 

6 

7 

8@pytest.mark.asyncio 

9async def test_delete_many(client: Prisma) -> None: 

10 """Standard usage""" 

11 posts = [ 

12 await client.post.create({'title': 'Foo post', 'published': False}), 

13 await client.post.create({'title': 'Bar post', 'published': False}), 

14 ] 

15 count = await client.post.delete_many() 

16 assert count >= 1 

17 

18 for post in posts: 

19 assert await client.post.find_unique(where={'id': post.id}) is None