Append "Z" to DATETIME_FORMAT

We're formally using the ISO 8601 UTC datetime format, and so the
correct way to output the data is by appending the timezone.
("Z" in the case of UTC*).

Unfortunately, Python's `datetime` formatting will just ignore the
timezone part of the string on output, which means we just have to
append the string "Z" to the end of all datetime strings we output.

Should be fine, as we will only ever output UTC timestamps anyway.

* https://en.wikipedia.org/wiki/ISO_8601#UTC
This commit is contained in:
Paul Craig
2016-11-21 15:16:21 +00:00
parent 82ba2cd226
commit c1fa5e156a
5 changed files with 13 additions and 13 deletions

View File

@@ -76,7 +76,7 @@ def test_should_process_sms_job(sample_job, mocker):
(str(sample_job.service_id),
"uuid",
"something_encrypted",
"2016-01-01T11:09:00.061258"),
"2016-01-01T11:09:00.061258Z"),
queue="db-sms"
)
job = jobs_dao.dao_get_job_by_id(sample_job.id)
@@ -104,7 +104,7 @@ def test_should_process_sms_job_into_research_mode_queue_if_research_mode_servic
(str(job.service_id),
"uuid",
"something_encrypted",
"2016-01-01T11:09:00.061258"),
"2016-01-01T11:09:00.061258Z"),
queue="research-mode"
)
@@ -133,7 +133,7 @@ def test_should_process_email_job_into_research_mode_queue_if_research_mode_serv
(str(job.service_id),
"uuid",
"something_encrypted",
"2016-01-01T11:09:00.061258"),
"2016-01-01T11:09:00.061258Z"),
queue="research-mode"
)
@@ -252,7 +252,7 @@ def test_should_process_email_job_if_exactly_on_send_limits(notify_db,
str(job.service_id),
"uuid",
"something_encrypted",
"2016-01-01T11:09:00.061258"
"2016-01-01T11:09:00.061258Z"
),
queue="db-email"
)
@@ -294,7 +294,7 @@ def test_should_process_email_job(sample_email_job, mocker):
str(sample_email_job.service_id),
"uuid",
"something_encrypted",
"2016-01-01T11:09:00.061258"
"2016-01-01T11:09:00.061258Z"
),
queue="db-email"
)