()
| 33 | |
| 34 | @create_drop_database(base_config=ormar_base_config) |
| 35 | async def run_query(): |
| 36 | await Book.objects.create( |
| 37 | title="Tom Sawyer", author="Twain, Mark", genre="Adventure" |
| 38 | ) |
| 39 | await Book.objects.create( |
| 40 | title="War and Peace", author="Tolstoy, Leo", genre="Fiction" |
| 41 | ) |
| 42 | await Book.objects.create( |
| 43 | title="Anna Karenina", author="Tolstoy, Leo", genre="Fiction" |
| 44 | ) |
| 45 | |
| 46 | await Book.objects.update(each=True, genre="Fiction") |
| 47 | all_books = await Book.objects.filter(genre="Fiction").all() |
| 48 | assert len(all_books) == 3 |
| 49 | |
| 50 | |
| 51 | asyncio.run(run_query()) |
no test coverage detected