mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 00:41:35 -05:00
Fixed bug where the content header was not being passed onto the post
request. Changed data => json. Added extra logging to display the error with more detail
This commit is contained in:
@@ -266,7 +266,7 @@ def _get_png_preview(url, data, notification_id):
|
|||||||
resp.content
|
resp.content
|
||||||
))
|
))
|
||||||
raise InvalidRequest(
|
raise InvalidRequest(
|
||||||
'Error generating preview letter for {} \nStatus code: {}\n{}'.format(
|
'Error generating preview letter for {}\nStatus code: {}\n{}'.format(
|
||||||
notification_id,
|
notification_id,
|
||||||
resp.status_code,
|
resp.status_code,
|
||||||
resp.content
|
resp.content
|
||||||
|
|||||||
@@ -874,7 +874,9 @@ def test_preview_letter_template_by_id_template_preview_500(
|
|||||||
_expected_status=500
|
_expected_status=500
|
||||||
)
|
)
|
||||||
|
|
||||||
assert resp['message'] == 'Error generating preview for {}'.format(sample_letter_notification.id)
|
assert 'Status code: 404' in resp['message']
|
||||||
|
assert 'Error generating preview letter for {}'.format(sample_letter_notification.id) in resp['message']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_preview_letter_template_precompiled_pdf_file_type(
|
def test_preview_letter_template_precompiled_pdf_file_type(
|
||||||
|
|||||||
Reference in New Issue
Block a user