| 259 | |
| 260 | @pytest.mark.asyncio |
| 261 | async def test_aggregate_max(db): |
| 262 | await testmodels.DecimalFields.create(decimal=Decimal("0"), decimal_nodec=1) |
| 263 | await testmodels.DecimalFields.create(decimal=Decimal("9.99"), decimal_nodec=1) |
| 264 | await testmodels.DecimalFields.create(decimal=Decimal("27.27"), decimal_nodec=1) |
| 265 | values = ( |
| 266 | await testmodels.DecimalFields.all() |
| 267 | .annotate(max_decimal=Max("decimal")) |
| 268 | .values("max_decimal") |
| 269 | ) |
| 270 | assert values[0] == {"max_decimal": Decimal("27.27")} |
| 271 | |
| 272 | |
| 273 | @pytest.mark.asyncio |