mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04: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:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
export NOTIFY_ADMIN_ENVIRONMENT='config.Test'
|
export NOTIFY_ADMIN_ENVIRONMENT='config.Test'
|
||||||
export ADMIN_CLIENT_SECRET='dev-notify-secret-key'
|
export ADMIN_CLIENT_SECRET='dev-notify-secret-key'
|
||||||
export ADMIN_CLIENT_USER_NAME='dev-notify-admin'
|
export ADMIN_CLIENT_USER_NAME='dev-notify-admin'
|
||||||
export API_HOST_NAME='http://localhost:6011'
|
export API_HOST_NAME='http://localhost:6311'
|
||||||
export DANGEROUS_SALT='dev-notify-salt'
|
export DANGEROUS_SALT='dev-notify-salt'
|
||||||
export SECRET_KEY='dev-notify-secret-key'
|
export SECRET_KEY='dev-notify-secret-key'
|
||||||
|
|||||||
@@ -158,7 +158,8 @@ def test_route_permissions_for_choose_template(mocker,
|
|||||||
app_,
|
app_,
|
||||||
api_user_active,
|
api_user_active,
|
||||||
service_one,
|
service_one,
|
||||||
mock_get_service_template):
|
mock_get_service_templates):
|
||||||
|
mocker.patch('app.job_api_client.get_job')
|
||||||
with app_.test_request_context():
|
with app_.test_request_context():
|
||||||
validate_route_permission(
|
validate_route_permission(
|
||||||
mocker,
|
mocker,
|
||||||
|
|||||||
+2
-2
@@ -158,13 +158,13 @@ def mock_get_service_statistics(mocker):
|
|||||||
|
|
||||||
@pytest.fixture(scope='function')
|
@pytest.fixture(scope='function')
|
||||||
def mock_get_service_template(mocker):
|
def mock_get_service_template(mocker):
|
||||||
def _create(service_id, template_id):
|
def _get(service_id, template_id):
|
||||||
template = template_json(
|
template = template_json(
|
||||||
service_id, template_id, "Two week reminder", "sms", "Your vehicle tax is about to expire")
|
service_id, template_id, "Two week reminder", "sms", "Your vehicle tax is about to expire")
|
||||||
return {'data': template}
|
return {'data': template}
|
||||||
|
|
||||||
return mocker.patch(
|
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')
|
@pytest.fixture(scope='function')
|
||||||
|
|||||||
Reference in New Issue
Block a user