Commit 0bc7a36d authored by David Mendez's avatar David Mendez
Browse files

Finally fix timezone awareness of dates hopefully

parent 865ba31c
......@@ -3,6 +3,7 @@ Tests for the status namespace
"""
import json
import unittest
import datetime
from app import create_app
from app.authorisation import token_generator
......@@ -56,7 +57,7 @@ class TestStatus(unittest.TestCase):
raw_value = getattr(job_must_be, prop)
value_must_be = raw_value
if raw_value is not None:
value_must_be = raw_value.astimezone().isoformat()
value_must_be = raw_value.replace(tzinfo=datetime.timezone.utc).isoformat()
value_got = resp_data[prop]
self.assertEqual(value_must_be, value_got, msg=f'The returned job {prop} is not correct.')
......
......@@ -112,8 +112,7 @@ def standardise_public_date(public_time):
if public_time is None:
return None
public_time.replace(tzinfo=datetime.timezone.utc)
return public_time.astimezone().isoformat()
return public_time.replace(tzinfo=datetime.timezone.utc).isoformat()
class DelayedJob(DB.Model):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment