MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / test_nested_functions

Function test_nested_functions

tests/test_aggregation.py:163–169  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

161
162@pytest.mark.asyncio
163async 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"))

Callers

nothing calls this directly

Calls 6

LowerClass · 0.90
MaxClass · 0.90
createMethod · 0.45
valuesMethod · 0.45
annotateMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…