add new send_notification api call

This commit is contained in:
Leo Hemsted
2017-06-22 15:56:05 +01:00
parent 1e979394bb
commit 3966d024d8
2 changed files with 24 additions and 1 deletions

View File

@@ -35,6 +35,20 @@ def test_client_gets_notifications_for_service_and_job_by_page(mocker, arguments
mock_get.assert_called_once_with(**expected_call)
def test_send_notification(mocker, logged_in_client, active_user_with_permissions):
mock_post = mocker.patch('app.notify_client.notification_api_client.NotificationApiClient.post')
NotificationApiClient().send_notification('foo', template_id='bar', recipient='07700900001')
mock_post.assert_called_once_with(
url='/service/foo/send-notification',
data={
'template_id': 'bar',
'to': '07700900001',
'personalisation': None,
'created_by': active_user_with_permissions.id
}
)
def test_get_notification(mocker):
mock_get = mocker.patch('app.notify_client.notification_api_client.NotificationApiClient.get')
NotificationApiClient().get_notification('foo', 'bar')