Update dateformat for scheduled_for to include minutes.

This commit is contained in:
Rebecca Law
2017-05-22 14:15:35 +01:00
parent 3a3161ecc4
commit 751abb4b99
5 changed files with 9 additions and 9 deletions

View File

@@ -343,8 +343,8 @@ def test_persist_notification_with_international_info_does_not_store_for_email(
def test_persist_scheduled_notification(sample_notification):
persist_scheduled_notification(sample_notification.id, '2017-05-12 14')
persist_scheduled_notification(sample_notification.id, '2017-05-12 14:15')
scheduled_notification = ScheduledNotification.query.all()
assert len(scheduled_notification) == 1
assert scheduled_notification[0].notification_id == sample_notification.id
assert scheduled_notification[0].scheduled_for == datetime.datetime(2017, 5, 12, 13, 0)
assert scheduled_notification[0].scheduled_for == datetime.datetime(2017, 5, 12, 13, 15)

View File

@@ -360,7 +360,7 @@ def test_get_notifications_response_with_email_and_phone_number():
def test_post_schema_valid_scheduled_for(schema):
j = {"template_id": str(uuid.uuid4()),
"email_address": "joe@gmail.com",
"scheduled_for": "2017-05-12 13"}
"scheduled_for": "2017-05-12 13:15"}
if schema == post_email_request_schema:
j.update({"email_address": "joe@gmail.com"})
else:
@@ -385,4 +385,4 @@ def test_post_email_schema_invalid_scheduled_for(invalid_datetime, schema):
assert error['status_code'] == 400
assert error['errors'] == [{'error': 'ValidationError',
'message': "scheduled_for datetime format is invalid. Use the format: "
"YYYY-MM-DD HH, for example 2017-05-30 13"}]
"YYYY-MM-DD HH:MI, for example 2017-05-30 13:15"}]

View File

@@ -358,7 +358,7 @@ def test_post_notification_with_scheduled_for(client, sample_template, sample_em
data = {
key_send_to: send_to,
'template_id': str(sample_email_template.id) if notification_type == 'email' else str(sample_template.id),
'scheduled_for': '2017-05-14 14'
'scheduled_for': '2017-05-14 14:15'
}
auth_header = create_authorization_header(service_id=sample_template.service_id)
@@ -370,4 +370,4 @@ def test_post_notification_with_scheduled_for(client, sample_template, sample_em
scheduled_notification = ScheduledNotification.query.all()
assert len(scheduled_notification) == 1
assert resp_json["id"] == str(scheduled_notification[0].notification_id)
assert resp_json["scheduled_for"] == '2017-05-14 14'
assert resp_json["scheduled_for"] == '2017-05-14 14:15'