Skip to content
Snippets Groups Projects
Verified Commit d3b74e17 authored by Marte Fossum's avatar Marte Fossum
Browse files

Fix id_type name given to cerebrum api

parent 249abc04
No related branches found
No related tags found
1 merge request!430Use mui alert for IGA warning and change IGA name
Pipeline #235124 passed
......@@ -40,7 +40,7 @@ def test_identity_check_nonexisting_fnr(
"""Verify that identitycheck endpoint checks iga when queried"""
settings.IGA_CHECK = True
requests_mock.get(
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=NO_BIRTHNO&external_id=12345612345",
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=norwegianNationalId&external_id=12345612345",
json={"external_ids": []},
)
log_in(user_sponsor)
......@@ -56,7 +56,7 @@ def test_identity_check_existing_fnr(
"""Verify that identitycheck endpoint checks iga when queried"""
settings.IGA_CHECK = True
requests_mock.get(
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=NO_BIRTHNO&external_id=12345612345",
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=norwegianNationalId&external_id=12345612345",
json={
"external_ids": [
{
......
......@@ -5,7 +5,7 @@ from ..uio import UioCerebrum
def test_uio_search_hit(requests_mock):
requests_mock.get(
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=NO_BIRTHNO&external_id=123",
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=norwegianNationalId&external_id=123",
json={
"external_ids": [
{
......@@ -18,7 +18,7 @@ def test_uio_search_hit(requests_mock):
},
)
requests_mock.get(
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=PASSNR&external_id=12345",
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=passportNumber&external_id=12345",
json={
"external_ids": [
{
......@@ -60,11 +60,11 @@ def test_uio_search_hit(requests_mock):
def test_uio_search_miss(requests_mock):
"""Verify no matches returns empty list"""
requests_mock.get(
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=NO_BIRTHNO&external_id=123",
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=norwegianNationalId&external_id=123",
json={"external_ids": []},
)
requests_mock.get(
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=PASSNR&external_id=12345",
"http://example.com/cerebrum/v1/search/persons/external-ids?id_type=passportNumber&external_id=12345",
json={"external_ids": []},
)
......
......@@ -13,8 +13,8 @@ class UioCerebrum(IgaImplementation):
def __init__(self, config) -> None:
self.client = CerebrumClient(**config)
self.idtype2cerebrum = {
Identity.IdentityType.NORWEGIAN_NATIONAL_ID_NUMBER: "NO_BIRTHNO",
Identity.IdentityType.PASSPORT_NUMBER: "PASSNR",
Identity.IdentityType.NORWEGIAN_NATIONAL_ID_NUMBER: "norwegianNationalId",
Identity.IdentityType.PASSPORT_NUMBER: "passportNumber",
}
def extid_search(
......
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