mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Add proper mocks for the test.
Updated the localhost in the environment_test file so that if the tests fail if a mock is missing.
This commit is contained in:
@@ -158,7 +158,8 @@ def test_route_permissions_for_choose_template(mocker,
|
||||
app_,
|
||||
api_user_active,
|
||||
service_one,
|
||||
mock_get_service_template):
|
||||
mock_get_service_templates):
|
||||
mocker.patch('app.job_api_client.get_job')
|
||||
with app_.test_request_context():
|
||||
validate_route_permission(
|
||||
mocker,
|
||||
|
||||
@@ -158,13 +158,13 @@ def mock_get_service_statistics(mocker):
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_service_template(mocker):
|
||||
def _create(service_id, template_id):
|
||||
def _get(service_id, template_id):
|
||||
template = template_json(
|
||||
service_id, template_id, "Two week reminder", "sms", "Your vehicle tax is about to expire")
|
||||
return {'data': template}
|
||||
|
||||
return mocker.patch(
|
||||
'app.service_api_client.get_service_template', side_effect=_create)
|
||||
'app.service_api_client.get_service_template', side_effect=_get)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
|
||||
Reference in New Issue
Block a user