(db)
| 161 | |
| 162 | @pytest.mark.asyncio |
| 163 | async def test_nested_functions(db): |
| 164 | author = await Author.create(name="Some One") |
| 165 | await Book.create(name="First!", author=author, rating=4) |
| 166 | await Book.create(name="Second!", author=author, rating=3) |
| 167 | await Book.create(name="Third!", author=author, rating=3) |
| 168 | ret = await Book.all().annotate(max_name=Lower(Max("name"))).values("max_name") |
| 169 | assert ret == [{"max_name": "third!"}] |
| 170 | |
| 171 | |
| 172 | @test.requireCapability(dialect=In("postgres", "mssql")) |