@@ -147,6 +147,26 @@ async def user_restricted_product(client, make_product):
147147 product .delete_product_by_name (product_name = productName )
148148
149149
150+ @pytest_asyncio .fixture
151+ async def user_restricted_product_ods_validation (client , make_product ):
152+ # Setup
153+ productName = await make_product (
154+ [
155+ "urn:nhsd:apim:user-nhs-id:aal3:e-referrals-service-api" ,
156+ "urn:nhsd:apim:user-nhs-id:aal2:e-referrals-service-api" ,
157+ ],
158+ additional_attributes = [{"name" : "EUOAllowlistRequired" , "value" : "true" }],
159+ )
160+
161+ print (f"product created: { productName } " )
162+ yield productName
163+
164+ # Teardown
165+ print (f"Cleanup product: { productName } " )
166+ product = ApiProductsAPI (client = client )
167+ product .delete_product_by_name (product_name = productName )
168+
169+
150170@pytest .fixture
151171def update_user_restricted_product (
152172 user_restricted_product , client : ApigeeClient
@@ -307,6 +327,27 @@ async def user_restricted_app(
307327 app .delete_app_by_name (email = "apm-testing-internal-dev@nhs.net" , app_name = appName )
308328
309329
330+ @pytest_asyncio .fixture
331+ async def user_restricted_app_ods_validation (
332+ client , make_app , user_restricted_product_ods_validation , asid , apim_app_flow_vars
333+ ):
334+ # Setup
335+ odslist = json .dumps ({"ers" : {"allowListodsCode" : apim_app_flow_vars }})
336+ app = await make_app (
337+ user_restricted_product_ods_validation ,
338+ {"asid" : asid , "apim-app-flow-vars" : odslist },
339+ )
340+
341+ appName = app ["name" ]
342+ print (f"App created: { appName } " )
343+ yield app
344+
345+ # Teardown
346+ print (f"Cleanup app: { appName } " )
347+ app = DeveloperAppsAPI (client = client )
348+ app .delete_app_by_name (email = "apm-testing-internal-dev@nhs.net" , app_name = appName )
349+
350+
310351@pytest .fixture
311352def make_app (client ):
312353 async def _make_app (product , custom_attributes = {}):
0 commit comments