mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-02 16:00:45 -05:00
Update dateformat for scheduled_for to include minutes.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"}]
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user