-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
572d56b
commit c94a228
Showing
2 changed files
with
80 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from datetime import datetime | ||
|
||
import pytest | ||
|
||
from onfido import ApplicantBuilder, ReportName, WatchlistMonitor | ||
from tests.conftest import create_applicant | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def applicant_id(onfido_api): | ||
applicant_builder = ApplicantBuilder( | ||
first_name="John", | ||
last_name="Smith", | ||
dob=datetime(year=1990, month=1, day=1), | ||
) | ||
return create_applicant(onfido_api, applicant_builder=applicant_builder).id | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def watchlist_monitor(onfido_api, applicant_id): | ||
return onfido_api.create_watchlist_monitor( | ||
WatchlistMonitor( | ||
applicant_id=applicant_id, report_name=ReportName.WATCHLIST_STANDARD | ||
) | ||
) | ||
|
||
|
||
def test_create_watchlist_standard_monitor(onfido_api, applicant_id, watchlist_monitor): | ||
assert watchlist_monitor.applicant_id == applicant_id | ||
assert watchlist_monitor.actual_instance.name == ReportName.WATCHLIST_STANDARD | ||
|
||
|
||
def test_create_watchlist_aml_monitor(onfido_api, applicant_id): | ||
watchlist_monitor = onfido_api.create_watchlist_monitor( | ||
WatchlistMonitor( | ||
applicant_id=applicant_id, report_name=ReportName.WATCHLIST_AML | ||
) | ||
) | ||
|
||
assert watchlist_monitor.applicant_id == applicant_id | ||
assert watchlist_monitor.actual_instance.name == ReportName.WATCHLIST_AML | ||
|
||
|
||
def test_list_watchlist_monitors(onfido_api, applicant_id, watchlist_monitor): | ||
list_of_monitors = onfido_api.list_watchlist_monitors( | ||
applicant_id, include_deleted=False | ||
) | ||
|
||
assert len(list_of_monitors) > 0 | ||
|
||
|
||
def test_find_watchlist_monitor(onfido_api, watchlist_monitor): | ||
get_watchlist_monitor = onfido_api.find_watchlist_monitor(watchlist_monitor.id) | ||
|
||
assert get_watchlist_monitor.id == watchlist_monitor.id | ||
|
||
|
||
def test_delete_watchlist_monitor(onfido_api, watchlist_monitor): | ||
onfido_api.delete_watchlist_monitor(watchlist_monitor.id) | ||
|
||
|
||
def test_list_watchlist_monitor_matches(onfido_api, watchlist_monitor): | ||
matches_list = onfido_api.list_watchlist_monitor_matches(watchlist_monitor.id) | ||
|
||
assert len(matches_list) == 0 | ||
|
||
|
||
def test_force_report_creation(onfido_api, watchlist_monitor): | ||
onfido_api.force_new_record_creation(watchlist_monitor.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters