mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Use new API endpoint to get single contact list
When we first built the contact list feature this endpoint didn’t exist. Now it does we can remove the slightly cludgy looping-through-all-the-lists code.
This commit is contained in:
@@ -1869,6 +1869,36 @@ def mock_get_contact_lists(mocker, api_user_active, fake_uuid):
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_contact_list(mocker, api_user_active, fake_uuid):
|
||||
def _get(*, service_id, contact_list_id):
|
||||
return {
|
||||
'created_at': '2020-03-13 10:59:56',
|
||||
'created_by': 'Test User',
|
||||
'id': fake_uuid,
|
||||
'original_file_name': 'EmergencyContactList.xls',
|
||||
'row_count': 100,
|
||||
'service_id': service_id,
|
||||
'template_type': 'email',
|
||||
}
|
||||
|
||||
return mocker.patch(
|
||||
'app.models.contact_list.contact_list_api_client.get_contact_list',
|
||||
side_effect=_get,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_no_contact_list(mocker, api_user_active, fake_uuid):
|
||||
def _get(*, service_id, contact_list_id):
|
||||
raise HTTPError(response=Mock(status_code=404))
|
||||
|
||||
return mocker.patch(
|
||||
'app.models.contact_list.contact_list_api_client.get_contact_list',
|
||||
side_effect=_get,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_no_contact_lists(mocker):
|
||||
return mocker.patch(
|
||||
|
||||
Reference in New Issue
Block a user