Refactored code to make it more maintainable and changed an error type

* Rather than an abort 404 returned a 500 and InvalidRequest so that the
error is more easily handled on the admin console. If the file is
missing but expected to be there is actually an internal error for admin
* Refactored the code to remove duplicate code in calls to template
preview by creating a new private method which is called with specific
parameters
This commit is contained in:
Richard Chapman
2018-03-05 14:54:18 +00:00
parent a4feaba309
commit e91a0efc43
2 changed files with 25 additions and 29 deletions

View File

@@ -949,7 +949,7 @@ def test_preview_letter_template_precompiled_s3_error(
service_id=notification.service_id,
notification_id=notification.id,
file_type='pdf',
_expected_status=404
_expected_status=500
)