@@ -84,6 +84,36 @@ def test_update_applicant(onfido_api, applicant_id):
8484 assert updated_applicant .dob == datetime .date (1990 , 1 , 22 )
8585
8686
87+ def test_list_applicant_consents (onfido_api , applicant_id ):
88+
89+ consents = [
90+ onfido .ApplicantConsentBuilder (
91+ name = onfido .ApplicantConsentName .PHONE_NUMBER_VERIFICATION ,
92+ granted = True ,
93+ granted_at = datetime .date (1990 , 1 , 22 )
94+ ),
95+ onfido .ApplicantConsentBuilder (
96+ name = onfido .ApplicantConsentName .PRIVACY_NOTICES_READ ,
97+ granted = True ,
98+ granted_at = datetime .date (1990 , 1 , 22 )
99+ ),
100+ onfido .ApplicantConsentBuilder (
101+ name = onfido .ApplicantConsentName .SSN_VERIFICATION ,
102+ granted = True ,
103+ granted_at = datetime .date (1990 , 1 , 22 )
104+ )
105+ ]
106+
107+ new_applicant_data = onfido .ApplicantUpdater (consents = consents )
108+
109+ onfido_api .update_applicant (applicant_id , new_applicant_data )
110+
111+ actual_consents = onfido_api .find_applicant_consents (applicant_id )
112+
113+ for actual , expected in zip (actual_consents , consents ):
114+ assert actual .name == expected .name
115+ assert actual .granted == expected .granted
116+
87117def test_delete_applicant (onfido_api , applicant_id ):
88118 onfido_api .delete_applicant (applicant_id )
89119
0 commit comments