Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ChEMBL
C
ChEMBL
Delayed Jobs
Delayed Jobs API
Commits
0bc7a36d
Commit
0bc7a36d
authored
Jan 28, 2021
by
David Mendez
Browse files
Finally fix timezone awareness of dates hopefully
parent
865ba31c
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/blueprints/job_status/test/test_job_status_requests.py
app/blueprints/job_status/test/test_job_status_requests.py
+2
-1
app/models/delayed_job_models.py
app/models/delayed_job_models.py
+1
-2
No files found.
app/blueprints/job_status/test/test_job_status_requests.py
View file @
0bc7a36d
...
...
@@ -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
.
as
timezone
(
).
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.'
)
...
...
app/models/delayed_job_models.py
View file @
0bc7a36d
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment