2828from pytest_simcore .helpers .webserver_users import UserInfoDict
2929from servicelib .aiohttp import status
3030from servicelib .rest_constants import RESPONSE_MODEL_POLICY
31+ from simcore_service_webserver .products ._models import Product
3132from simcore_service_webserver .user_preferences ._service import (
3233 get_frontend_user_preferences_aggregation ,
3334)
@@ -133,6 +134,14 @@ async def test_access_update_profile(
133134 await assert_status (resp , expected )
134135
135136
137+ @pytest .fixture
138+ def product (client : TestClient , osparc_product_name : str ) -> Product :
139+ assert client .app
140+ from simcore_service_webserver .products import products_service
141+
142+ return products_service .get_product (client .app , osparc_product_name )
143+
144+
136145@pytest .mark .parametrize ("user_role" , [UserRole .USER ])
137146async def test_get_profile_user_not_in_support_group (
138147 support_group_before_app_starts : dict [str , Any ],
@@ -143,6 +152,7 @@ async def test_get_profile_user_not_in_support_group(
143152 primary_group : dict [str , Any ],
144153 standard_groups : list [dict [str , Any ]],
145154 all_group : dict [str , str ],
155+ product : Product ,
146156):
147157 assert client .app
148158
@@ -168,7 +178,7 @@ async def test_get_profile_user_not_in_support_group(
168178 assert got_profile_groups ["product" ] == {
169179 "accessRights" : {"delete" : False , "read" : False , "write" : False },
170180 "description" : "osparc product group" ,
171- "gid" : 3 ,
181+ "gid" : product . group_id ,
172182 "label" : "osparc" ,
173183 "thumbnail" : None ,
174184 }
@@ -210,6 +220,7 @@ async def test_get_profile_user_in_support_group(
210220 primary_group : dict [str , Any ],
211221 standard_groups : list [dict [str , Any ]],
212222 all_group : dict [str , str ],
223+ product : Product ,
213224):
214225 assert client .app
215226 from simcore_service_webserver .groups import _groups_repository
@@ -244,7 +255,7 @@ async def test_get_profile_user_in_support_group(
244255 assert got_profile_groups ["product" ] == {
245256 "accessRights" : {"delete" : False , "read" : False , "write" : False },
246257 "description" : "osparc product group" ,
247- "gid" : 3 ,
258+ "gid" : product . group_id ,
248259 "label" : "osparc" ,
249260 "thumbnail" : None ,
250261 }
0 commit comments