Added mock api call to appropriate tests

This commit is contained in:
Andrew Shumway
2023-11-02 16:28:09 -04:00
committed by Carlo Costino
parent af119aad1c
commit 591961413a
2 changed files with 24 additions and 0 deletions
@@ -321,6 +321,14 @@ def test_route_permissions(
route, route,
): ):
with notify_admin.test_request_context(): with notify_admin.test_request_context():
def _get(mocker):
return {"count": 0}
mocker.patch(
"app.service_api_client.get_global_notification_count", side_effect=_get
)
validate_route_permission( validate_route_permission(
mocker, mocker,
notify_admin, notify_admin,
@@ -346,6 +354,14 @@ def test_route_invalid_permissions(
route, route,
): ):
with notify_admin.test_request_context(): with notify_admin.test_request_context():
def _get(mocker):
return {"count": 0}
mocker.patch(
"app.service_api_client.get_global_notification_count", side_effect=_get
)
validate_route_permission( validate_route_permission(
mocker, mocker,
notify_admin, notify_admin,
+8
View File
@@ -1174,6 +1174,14 @@ def test_route_for_service_permissions(
mock_get_inbound_sms_summary, mock_get_inbound_sms_summary,
): ):
with notify_admin.test_request_context(): with notify_admin.test_request_context():
def _get(mocker):
return {"count": 0}
mocker.patch(
"app.service_api_client.get_global_notification_count", side_effect=_get
)
validate_route_permission( validate_route_permission(
mocker, mocker,
notify_admin, notify_admin,