mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 18:37:33 -04:00
Added mock api call to appropriate tests
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user