Skip to content

Commit ab32fdc

Browse files
committed
adds test for find_applicant_consents
1 parent 8f9c70f commit ab32fdc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/test_applicants.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,35 @@ def test_update_applicant(onfido_api, applicant_id):
8383
assert updated_applicant.last_name == "Doe"
8484
assert updated_applicant.dob == datetime.date(1990, 1, 22)
8585

86+
def test_list_applicant_consents(onfido_api, applicant_id):
87+
new_applicant_data = onfido.ApplicantUpdater(
88+
consents=[
89+
{
90+
'name': onfido.ApplicantConsentName.PRIVACY_NOTICES_READ,
91+
'granted': True
92+
},
93+
{
94+
'name': onfido.ApplicantConsentName.SSN_VERIFICATION,
95+
'granted': True
96+
},
97+
{
98+
'name': onfido.ApplicantConsentName.PHONE_NUMBER_VERIFICATION,
99+
'granted': True
100+
}
101+
]
102+
)
103+
104+
onfido_api.update_applicant(applicant_id, new_applicant_data)
105+
106+
107+
expected_consents = [
108+
{'name': 'phone_number_verification', 'granted': True},
109+
{'name': 'privacy_notices_read', 'granted': True},
110+
{'name': 'ssn_verification', 'granted': True}
111+
]
112+
113+
consents = onfido_api.find_applicant_consents(applicant_id)
114+
assert consents == expected_consents
86115

87116
def test_delete_applicant(onfido_api, applicant_id):
88117
onfido_api.delete_applicant(applicant_id)

0 commit comments

Comments
 (0)