Merge pull request #898 from alphagov/update-letter-jobs

Update letter jobs
response changed to 201
This commit is contained in:
kentsanggds
2017-04-11 17:07:12 +01:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ def send_letter_jobs():
job_ids = validate(request.get_json(), letter_job_ids)
notify_celery.send_task(name="send-files-to-dvla", args=(job_ids['job_ids'],), queue="process-ftp")
return "Task created to send files to DVLA"
return jsonify(data={"response": "Task created to send files to DVLA"}), 201
@letter_job.route('/letter-jobs', methods=['GET'])

View File

@@ -16,8 +16,8 @@ def test_send_letter_jobs(client, mocker):
data=json.dumps(job_ids),
headers=[('Content-Type', 'application/json'), auth_header])
assert response.status_code == 200
assert response.get_data(as_text=True) == "Task created to send files to DVLA"
assert response.status_code == 201
assert json.loads(response.get_data())['data'] == {'response': "Task created to send files to DVLA"}
mock_celery.assert_called_once_with(name="send-files-to-dvla",
args=(job_ids['job_ids'],),