test(collections): resolve hash smart collections through the gallery query

The hash search tests reached membership through
`get_smart_collection_roms`, which no longer exists now that a smart
collection is served as a composed query. Ask for the collection the way
the gallery does instead, so the criterion is still exercised end to end.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-08-01 15:08:42 -04:00
parent 33d68c32a5
commit e464ce765a

View File

@@ -199,8 +199,8 @@ class TestSmartCollectionSearchTerm:
def test_hash_criterion_resolves_members(self, aero: Rom, admin_user: User):
collection = self._smart_collection(admin_user, AERO_MD5)
roms = db_collection_handler.get_smart_collection_roms(
collection, user_id=admin_user.id
roms = db_rom_handler.get_roms_scalar(
smart_collection_id=collection.id, user_id=admin_user.id
)
assert [rom.id for rom in roms] == [aero.id]
@@ -210,8 +210,8 @@ class TestSmartCollectionSearchTerm:
):
collection = self._smart_collection(admin_user, DISC_ONE_MD5)
roms = db_collection_handler.get_smart_collection_roms(
collection, user_id=admin_user.id
roms = db_rom_handler.get_roms_scalar(
smart_collection_id=collection.id, user_id=admin_user.id
)
assert [rom.id for rom in roms] == [multi_disc.id]