make job.created_by nullable

Since letter jobs from the API aren't created by any single individual,
lets make created_by nullable. Note: We'll have to make sure that we
update the admin app to handle these jobs nicely
This commit is contained in:
Leo Hemsted
2017-07-27 12:58:13 +01:00
parent 11458c421b
commit f528236eda
4 changed files with 27 additions and 7 deletions

View File

@@ -1,4 +1,3 @@
import uuid
from flask import url_for, json
@@ -11,9 +10,6 @@ from tests import create_authorization_header
from tests.app.db import create_service, create_template
pytestmark = pytest.mark.skip('Leters not currently implemented')
def letter_request(client, data, service_id, _expected_status=201):
resp = client.post(
url_for('v2_notifications.post_notification', notification_type='letter'),
@@ -160,7 +156,7 @@ def test_post_letter_notification_returns_403_if_not_allowed_to_send_notificatio
}
error_json = letter_request(client, data, service_id=service.id, _expected_status=400)
assert error_json['status_code'] == 403
assert error_json['status_code'] == 400
assert error_json['errors'] == [
{'error': 'BadRequestError', 'message': 'Cannot send letters'}
]