Skip to content
Snippets Groups Projects

GREG-165: Handling case where guest uses ID porten for login

Merged Tore.Brede requested to merge GREG-165_handle_id_porten_login_in_guest_registration into master
1 file
+ 36
36
Compare changes
  • Side-by-side
  • Inline
@@ -73,7 +73,7 @@ def test_get_invited_info_no_session(client, invitation_link):
@pytest.mark.django_db
def test_get_invited_info_session_okay(
client, invited_person, sponsor_foo_data, role_type_foo, unit_foo
client, invited_person, sponsor_foo_data, role_type_foo, unit_foo
):
person, invitation_link = invited_person
# get a session
@@ -112,7 +112,7 @@ def test_get_invited_info_session_okay(
@pytest.mark.django_db
def test_get_invited_info_expired_link(
client, invitation_link, invitation_expired_date
client, invitation_link, invitation_expired_date
):
# Get a session while link is valid
client.get(
@@ -130,7 +130,7 @@ def test_get_invited_info_expired_link(
@pytest.mark.django_db
def test_invited_guest_can_post_information(
client: APIClient, invited_person, confirmation_template
client: APIClient, invited_person, confirmation_template
):
person, invitation_link = invited_person
# get a session
@@ -161,7 +161,7 @@ def test_invited_guest_can_post_information(
@pytest.mark.django_db
def test_post_invited_info_expired_session(
client, invitation_link, invitation_expired_date
client, invitation_link, invitation_expired_date
):
# get a session
client.post(
@@ -220,7 +220,7 @@ def test_post_invited_info_invalid_national_id_number(client, invited_person):
@pytest.mark.django_db
def test_post_invited_info_valid_national_id_number(
client, invited_person, confirmation_template
client, invited_person, confirmation_template
):
person, invitation_link = invited_person
fnr = "11120618212"
@@ -286,10 +286,10 @@ def test_register_passport(client, invited_person, confirmation_template):
session.save()
assert (
Identity.objects.filter(
person__id=person.id, type=Identity.IdentityType.PASSPORT_NUMBER
).count()
== 0
Identity.objects.filter(
person__id=person.id, type=Identity.IdentityType.PASSPORT_NUMBER
).count()
== 0
)
response = client.post(url, data, format="json")
@@ -306,15 +306,15 @@ def test_register_passport(client, invited_person, confirmation_template):
@pytest.mark.django_db
def test_name_update_not_allowed_if_feide_identity_is_present(
client: APIClient,
person_foo,
sponsor_foo,
unit_foo,
role_type_foo,
create_role,
create_invitation,
create_invitation_link,
invitation_valid_date,
client: APIClient,
person_foo,
sponsor_foo,
unit_foo,
role_type_foo,
create_role,
create_invitation,
create_invitation_link,
invitation_valid_date,
):
# This person has a Feide ID, so the name is assumed to come from there as well
# and the guest should not be allowed to update it
@@ -352,16 +352,16 @@ def test_name_update_not_allowed_if_feide_identity_is_present(
@pytest.mark.django_db
def test_name_update_allowed_if_feide_identity_is_not_present(
client: APIClient,
create_person,
sponsor_foo,
unit_foo,
role_type_foo,
create_role,
create_invitation,
create_invitation_link,
invitation_valid_date,
confirmation_template,
client: APIClient,
create_person,
sponsor_foo,
unit_foo,
role_type_foo,
create_role,
create_invitation,
create_invitation_link,
invitation_valid_date,
confirmation_template,
):
# This person does not have a Feide ID, so he will be viewed as someone whose name was entered manually
# by the sponsor, and in it that case the guest can update it
@@ -440,7 +440,7 @@ def test_post_info_fail_unknown_field(client, invited_person_verified_nin):
@pytest.mark.django_db
def test_date_of_birth_stored(
client, invited_person_verified_nin, confirmation_template
client, invited_person_verified_nin, confirmation_template
):
_, invitation_link = invited_person_verified_nin
@@ -457,8 +457,8 @@ def test_date_of_birth_stored(
person = Person.objects.get()
assert (
person.date_of_birth
== datetime.datetime.strptime(date_of_birth, "%Y-%m-%d").date()
person.date_of_birth
== datetime.datetime.strptime(date_of_birth, "%Y-%m-%d").date()
)
@@ -483,7 +483,7 @@ def test_invalid_date_of_birth_rejected(client, invited_person_verified_nin):
@pytest.mark.django_db
def test_saves_consents(
client, invited_person, consent_type_foo, consent_type_bar, confirmation_template
client, invited_person, consent_type_foo, consent_type_bar, confirmation_template
):
person, invitation_link = invited_person
fnr = "11120618212"
@@ -572,7 +572,7 @@ def test_gender_stored(client, invited_person_verified_nin, confirmation_templat
@pytest.mark.django_db
def test_gender_blank_allowed(
client, invited_person_verified_nin, confirmation_template
client, invited_person_verified_nin, confirmation_template
):
_, invitation_link = invited_person_verified_nin
@@ -617,7 +617,7 @@ def test_invalid_gender_rejected(client, invited_person_verified_nin):
@pytest.mark.django_db
def test_session_type_feide_id(
client, invited_person_feide_id_set, log_in, user_no_profile
client, invited_person_feide_id_set, log_in, user_no_profile
):
_, invitation_link = invited_person_feide_id_set
# get a session
@@ -632,7 +632,7 @@ def test_session_type_feide_id(
@pytest.mark.django_db
def test_session_type_feide_id_name_update_fails(
client, invited_person_feide_id_set, log_in, user_no_profile
client, invited_person_feide_id_set, log_in, user_no_profile
):
person, invitation_link = invited_person_feide_id_set
# get a session
@@ -668,7 +668,7 @@ def test_session_type_feide_id_name_update_fails(
@pytest.mark.django_db
def test_session_type_id_porten(
client, invited_person_id_porten_nin_set, log_in, user_no_profile
client, invited_person_id_porten_nin_set, log_in, user_no_profile, confirmation_template
):
person, invitation_link = invited_person_id_porten_nin_set
# get a session
Loading