Query with select() in Grid and Path

`Session.query()` is the legacy API in SQLAlchemy 2.x.

Unlike `Query`, `select()` does not deduplicate single entities from a `JOIN`;
so, `Grid.gridify()` calls `.unique()` explicitly.

The `addresses_mock` fixtures mock the new call chain.
This commit is contained in:
Alexander Hess 2026-12-01 23:29:18 +01:00
commit 53e1859ee8
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -102,7 +102,7 @@ class TestGridification:
all considered `Order.pickup_address` attributes for some orders.
"""
mock = mocker.Mock()
query = mock.query.return_value.join.return_value.filter.return_value.all
query = mock.scalars.return_value.unique.return_value.all
monkeypatch.setattr(db, "session", mock)
return query