mirror of
https://github.com/rommapp/romm.git
synced 2026-06-29 07:16:28 +00:00
25 lines
751 B
Python
25 lines
751 B
Python
from handler.database import db_collection_handler
|
|
from models.collection import SmartCollection
|
|
from models.user import User
|
|
|
|
|
|
def test_get_smart_collection_roms_normalizes_legacy_selected_status_lists(
|
|
admin_user: User, mocker
|
|
):
|
|
get_roms_scalar = mocker.patch("handler.database.db_rom_handler.get_roms_scalar")
|
|
smart_collection = SmartCollection(
|
|
name="Finished games",
|
|
description="",
|
|
user_id=admin_user.id,
|
|
filter_criteria={"selected_status": ["finished", "completed_100"]},
|
|
)
|
|
|
|
db_collection_handler.get_smart_collection_roms(
|
|
smart_collection, user_id=admin_user.id
|
|
)
|
|
|
|
assert get_roms_scalar.call_args.kwargs["statuses"] == [
|
|
"finished",
|
|
"completed_100",
|
|
]
|