Updated API to get it working with Admin.

* Added missing items from template which are required
* Returned the file as a JSON string with the file as a base64 encoded
string
* Updated tests to match teh desired format
This commit is contained in:
Richard Chapman
2018-02-27 15:57:37 +00:00
committed by Ken Tsang
parent 4c8bc9f430
commit 42c1040604
4 changed files with 48 additions and 48 deletions

View File

@@ -157,7 +157,6 @@ def test_create_letters_pdf_handles_s3_errors(mocker, sample_letter_notification
'Type': 'Sender'
}
}
mock_s3 = mocker.patch('app.letters.utils.s3upload', side_effect=ClientError(error_response, 'operation_name'))
mock_retry = mocker.patch('app.celery.letters_pdf_tasks.create_letters_pdf.retry')

View File

@@ -1258,7 +1258,6 @@ def test_build_dvla_file_retries_if_s3_err(sample_letter_template, mocker):
'Type': 'Sender'
}
}
mocker.patch('app.celery.tasks.LetterDVLATemplate', return_value='dvla|string')
mocker.patch('app.celery.tasks.s3upload', side_effect=ClientError(error_response, 'operation_name'))
retry_mock = mocker.patch('app.celery.tasks.build_dvla_file.retry', side_effect=Retry)