Skip to content

Commit 5caa34c

Browse files
committed
Make applicants tests more resilient
1 parent beabe1c commit 5caa34c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/test_applicants.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ def test_update_applicant(onfido_api, applicant_id):
8585

8686

8787
def test_list_applicant_consents(onfido_api, applicant_id):
88-
89-
consents = [
88+
consents = sorted([
9089
onfido.ApplicantConsentBuilder(
9190
name=onfido.ApplicantConsentName.PHONE_NUMBER_VERIFICATION,
9291
granted=True,
@@ -102,13 +101,15 @@ def test_list_applicant_consents(onfido_api, applicant_id):
102101
granted=True,
103102
granted_at=datetime.date(1990, 1, 22)
104103
)
105-
]
104+
], key=lambda x: x.name)
106105

107106
new_applicant_data = onfido.ApplicantUpdater(consents=consents)
108107

109108
onfido_api.update_applicant(applicant_id, new_applicant_data)
110109

111-
actual_consents = onfido_api.find_applicant_consents(applicant_id)
110+
actual_consents = sorted(
111+
onfido_api.find_applicant_consents(applicant_id),
112+
key=lambda x: x.name)
112113

113114
for actual, expected in zip(actual_consents, consents):
114115
assert actual.name == expected.name

0 commit comments

Comments
 (0)