Coverage for databases/partials.py: 100%

7 statements  

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

1from prisma.models import Post, User 

2 

3Post.create_partial('PostOnlyPublished', include={'id', 'published'}) 

4Post.create_partial('PostWithAuthor', include={'id', 'title', 'author'}) 

5 

6User.create_partial('UserOnlyName', include={'name'}) 

7Post.create_partial( 

8 'PostWithCustomAuthor', 

9 include={'id', 'title', 'author'}, 

10 relations={ 

11 'author': 'UserOnlyName', 

12 }, 

13) 

14 

15User.create_partial('UserWithPosts', include={'name', 'posts'}) 

16Post.create_partial( 

17 'PostWithNestedRelations', 

18 include={'id', 'title', 'author'}, 

19 relations={ 

20 'author': 'UserWithPosts', 

21 }, 

22)