mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 07:38:25 -04:00
Add endpoint for cancelling letters to NotificationApiClient
This commit is contained in:
@@ -93,5 +93,10 @@ class NotificationApiClient(NotifyAdminAPIClient):
|
|||||||
|
|
||||||
return self.get(url=get_url)
|
return self.get(url=get_url)
|
||||||
|
|
||||||
|
def update_notification_to_cancelled(self, service_id, notification_id):
|
||||||
|
return self.post(
|
||||||
|
url='/service/{}/notifications/{}/cancel'.format(service_id, notification_id),
|
||||||
|
data={})
|
||||||
|
|
||||||
|
|
||||||
notification_api_client = NotificationApiClient()
|
notification_api_client = NotificationApiClient()
|
||||||
|
|||||||
@@ -85,3 +85,12 @@ def test_get_api_notifications_changes_letter_statuses(mocker):
|
|||||||
assert ret['notifications'][0]['status'] == 'created'
|
assert ret['notifications'][0]['status'] == 'created'
|
||||||
assert ret['notifications'][1]['status'] == 'created'
|
assert ret['notifications'][1]['status'] == 'created'
|
||||||
assert ret['notifications'][2]['status'] == 'accepted'
|
assert ret['notifications'][2]['status'] == 'accepted'
|
||||||
|
|
||||||
|
|
||||||
|
def test_update_notification_to_cancelled(mocker):
|
||||||
|
mock_post = mocker.patch('app.notify_client.notification_api_client.NotificationApiClient.post')
|
||||||
|
NotificationApiClient().update_notification_to_cancelled('foo', 'bar')
|
||||||
|
mock_post.assert_called_once_with(
|
||||||
|
url='/service/foo/notifications/bar/cancel',
|
||||||
|
data={},
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user