Skip to content

Commit 35f742d

Browse files
committed
APM-5874: Amend tests for spearate auth happy path
1 parent 1609349 commit 35f742d

1 file changed

Lines changed: 12 additions & 52 deletions

File tree

tests/test_user_role_service_v2.py

Lines changed: 12 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@
3535
),
3636
id="User role sent in header (no in id token, multiple in user info)",
3737
),
38+
pytest.param(
39+
{"NHSD-Session-URID": "656014452101"},
40+
"656014452101",
41+
marks=pytest.mark.nhsd_apim_authorization(
42+
access="healthcare_worker",
43+
level="aal3",
44+
login_form={"username": "656005750104"},
45+
authentication="separate",
46+
force_new_token=True,
47+
),
48+
id="CIS2 separate: User role sent in header",
49+
),
3850
]
3951
UNHAPPY_PATH_PARAMS = [
4052
pytest.param(
@@ -124,58 +136,6 @@
124136
),
125137
id="NHS Login combined: Can't use header to fetch from userinfo",
126138
),
127-
pytest.param(
128-
{},
129-
"selected_roleid is missing in your token",
130-
401,
131-
marks=pytest.mark.nhsd_apim_authorization(
132-
access="patient",
133-
level="P9",
134-
login_form={"username": "9912003071"},
135-
authentication="separate",
136-
force_new_token=True,
137-
),
138-
id="NHS Login separate: Role can't be used from token",
139-
),
140-
pytest.param(
141-
{"NHSD-Session-URID": "9912003071"},
142-
"unable to retrieve user info",
143-
500,
144-
marks=pytest.mark.nhsd_apim_authorization(
145-
access="patient",
146-
level="P9",
147-
login_form={"username": "9912003071"},
148-
authentication="separate",
149-
force_new_token=True,
150-
),
151-
id="NHS Login separate: Can't use header to fetch from userinfo",
152-
),
153-
pytest.param(
154-
{},
155-
"selected_roleid is missing in your token",
156-
401,
157-
marks=pytest.mark.nhsd_apim_authorization(
158-
access="healthcare_worker",
159-
level="aal3",
160-
login_form={"username": "656005750104"},
161-
authentication="separate",
162-
force_new_token=True,
163-
),
164-
id="CIS2 separate: Role can't be used from token",
165-
),
166-
pytest.param(
167-
{"NHSD-Session-URID": "656005750104"},
168-
"unable to retrieve user info",
169-
500,
170-
marks=pytest.mark.nhsd_apim_authorization(
171-
access="healthcare_worker",
172-
level="aal3",
173-
login_form={"username": "656005750104"},
174-
authentication="separate",
175-
force_new_token=True,
176-
),
177-
id="CIS2 separate: Can't use header to fetch from userinfo",
178-
),
179139
]
180140

181141

0 commit comments

Comments
 (0)