Skip to content
Snippets Groups Projects
Commit fe828e07 authored by Sivert Kronen Hatteberg's avatar Sivert Kronen Hatteberg
Browse files

Update tests to check auth_type

parent 4c5b0f4a
No related branches found
No related tags found
1 merge request!192Greg 87 invitation logout
Pipeline #102797 passed
......@@ -19,6 +19,7 @@ def test_userinfo_invited_get(client, invitation_link):
response = client.get(reverse("api-userinfo"))
assert response.status_code == status.HTTP_200_OK
assert response.json() == {
"auth_type": "invite",
"feide_id": None,
"sponsor_id": None,
"person_id": 1,
......@@ -51,6 +52,7 @@ def test_userinfo_sponsor_get(client, log_in, user_sponsor):
response = client.get(reverse("api-userinfo"))
assert response.status_code == status.HTTP_200_OK
assert response.json() == {
"auth_type": "oidc",
"feide_id": "",
"person_id": None,
"roles": [],
......@@ -65,6 +67,7 @@ def test_userinfo_guest_get(client, log_in, user_person):
response = client.get(reverse("api-userinfo"))
assert response.status_code == status.HTTP_200_OK
assert response.json() == {
"auth_type": "oidc",
"feide_id": "",
"sponsor_id": None,
"person_id": 1,
......
......@@ -458,6 +458,7 @@ def log_in(client) -> Callable[[UserModel], APIClient]:
# It seems like the session was not updated automatically this way
session = client.session
session["oidc_id_token_payload"] = {"iat": time.time()}
session["oidc_states"] = {}
session.save()
return client
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment