From 9ab97d34816148eb689e2861f32f7fccc8a16afd Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Wed, 16 Jan 2019 16:57:57 +0000 Subject: [PATCH] Return notification postage in response for .post_precompiled_letter_notification --- app/v2/notifications/post_notifications.py | 3 ++- tests/app/v2/notifications/test_post_letter_notifications.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/v2/notifications/post_notifications.py b/app/v2/notifications/post_notifications.py index b40e4e4b6..511155a7e 100644 --- a/app/v2/notifications/post_notifications.py +++ b/app/v2/notifications/post_notifications.py @@ -94,7 +94,8 @@ def post_precompiled_letter_notification(): resp = { 'id': notification.id, - 'reference': notification.client_reference + 'reference': notification.client_reference, + 'postage': notification.postage } return jsonify(resp), 201 diff --git a/tests/app/v2/notifications/test_post_letter_notifications.py b/tests/app/v2/notifications/test_post_letter_notifications.py index db6cd4159..22232aa73 100644 --- a/tests/app/v2/notifications/test_post_letter_notifications.py +++ b/tests/app/v2/notifications/test_post_letter_notifications.py @@ -510,7 +510,7 @@ def test_post_precompiled_letter_notification_returns_201( assert notification_history.postage == expected_postage resp_json = json.loads(response.get_data(as_text=True)) - assert resp_json == {'id': str(notification.id), 'reference': 'letter-reference'} + assert resp_json == {'id': str(notification.id), 'reference': 'letter-reference', 'postage': expected_postage} def test_post_letter_notification_throws_error_for_invalid_postage(client, notify_user, mocker):