(db)
| 172 | @test.requireCapability(dialect=In("postgres", "mssql")) |
| 173 | @pytest.mark.asyncio |
| 174 | async def test_concat_functions(db): |
| 175 | author = await Author.create(name="Some One") |
| 176 | await Book.create(name="Physics Book", author=author, rating=4, subject="physics ") |
| 177 | await Book.create(name="Mathematics Book", author=author, rating=3, subject=" mathematics") |
| 178 | await Book.create(name="No-subject Book", author=author, rating=3) |
| 179 | ret = ( |
| 180 | await Book.all() |
| 181 | .annotate(long_info=Max(Concat("name", "(", Coalesce(Trim("subject"), "others"), ")"))) |
| 182 | .values("long_info") |
| 183 | ) |
| 184 | assert ret == [{"long_info": "Physics Book(physics)"}] |
| 185 | |
| 186 | |
| 187 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected
searching dependent graphs…