File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
src/simcore_service_webserver/licenses
tests/unit/with_dbs/04/licenses Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -313,11 +313,11 @@ async def list_licensed_items(
313313 )
314314
315315 if filter_by_licensed_resource_type :
316- base_query .where (
316+ base_query = base_query .where (
317317 licensed_items .c .licensed_resource_type == filter_by_licensed_resource_type
318318 )
319319 if not include_hidden_items_on_market :
320- base_query .where (licensed_items .c .is_hidden_on_market .is_ (False ))
320+ base_query = base_query .where (licensed_items .c .is_hidden_on_market .is_ (False ))
321321
322322 # Select total count from base_query
323323 subquery = base_query .subquery ()
Original file line number Diff line number Diff line change 2727from simcore_postgres_database .models .licensed_item_to_resource import (
2828 licensed_item_to_resource ,
2929)
30+ from simcore_postgres_database .models .licensed_items import licensed_items
3031from simcore_postgres_database .utils_repos import transaction_context
3132from simcore_service_webserver .db .models import UserRole
3233from simcore_service_webserver .db .plugin import get_asyncpg_engine
@@ -103,6 +104,21 @@ async def test_licensed_items_listing(
103104 assert "additionalField" not in source
104105 assert "additional_field" not in source
105106
107+ # Testing hidden flag
108+ async with transaction_context (get_asyncpg_engine (client .app )) as conn :
109+ await conn .execute (
110+ licensed_items .update ()
111+ .values (
112+ is_hidden_on_market = True ,
113+ )
114+ .where (licensed_items .c .licensed_item_id == _licensed_item_id )
115+ )
116+
117+ url = client .app .router ["list_licensed_items" ].url_for ()
118+ resp = await client .get (f"{ url } " )
119+ data , _ = await assert_status (resp , status .HTTP_200_OK )
120+ assert data == []
121+
106122
107123_LICENSED_ITEM_PURCHASE_GET = (
108124 rut_licensed_items_purchases .LicensedItemPurchaseGet .model_validate (
You can’t perform that action at this time.
0 commit comments