@@ -135,38 +135,29 @@ async def test_nhs_login_exchanged_token_no_role_provided(
135135
136136 @pytest .mark .simulated_auth
137137 @pytest .mark .asyncio
138- async def test_cis2_exchanged_token_happy_path (
139- self ,
140- get_token_cis2_token_exchange
141- ):
142- token = get_token_cis2_token_exchange ["access_token" ]
143- headers = {
144- "Authorization" : f"Bearer { token } " ,
145- }
146-
147- response = requests .get (
148- url = f"https://internal-dev.api.service.nhs.uk/{ config .SERVICE_BASE_PATH } /user-role-service" ,
149- headers = headers
138+ @pytest .mark .parametrize ("additional_headers" , [
139+ (
140+ {}
141+ ),
142+ (
143+ {"NHSD-Session-URID" : "656014452101" }
150144 )
151-
152- assert response .status_code == 200
153-
154- @pytest .mark .simulated_auth
155- @pytest .mark .asyncio
145+ ])
156146 async def test_cis2_exchanged_token_no_role_provided (
157147 self ,
158- get_token_cis2_token_exchange
148+ get_token_cis2_token_exchange ,
149+ additional_headers
159150 ):
160151 token = get_token_cis2_token_exchange ["access_token" ]
161152 headers = {
162153 "Authorization" : f"Bearer { token } " ,
163- "NHSD-Session-URID" : "656014452101"
164154 }
155+ for key , value in additional_headers .items ():
156+ headers [key ] = value
165157
166158 response = requests .get (
167159 url = f"https://internal-dev.api.service.nhs.uk/{ config .SERVICE_BASE_PATH } /user-role-service" ,
168160 headers = headers
169161 )
170162
171- assert response .status_code == 400
172- assert response .json ()["issue" ][0 ]["diagnostics" ] == "unable to retrieve user info"
163+ assert response .status_code == 200
0 commit comments