diff options
author | 2022-07-24 10:06:47 +0200 | |
---|---|---|
committer | 2022-07-24 10:06:47 +0200 | |
commit | f16d3b1b1d14cdf0de1e56ae2bc466152e930f34 (patch) | |
tree | 61a957e380abab3ecbe5afb50b3acd778daf7b04 /pydis_site/apps/api/tests | |
parent | Use Dataclass For Workflow Run (diff) |
Use UTC Time For GitHub API
When reading the created_at time from the GitHub API, it'll be a naive
date string with UTC time, so we use that instead of the system's time.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/apps/api/tests')
-rw-r--r-- | pydis_site/apps/api/tests/test_github_utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pydis_site/apps/api/tests/test_github_utils.py b/pydis_site/apps/api/tests/test_github_utils.py index f5e072a9..f642f689 100644 --- a/pydis_site/apps/api/tests/test_github_utils.py +++ b/pydis_site/apps/api/tests/test_github_utils.py @@ -49,7 +49,7 @@ class CheckRunTests(unittest.TestCase): "head_sha": "sha", "status": "completed", "conclusion": "success", - "created_at": datetime.datetime.now().strftime(github_utils.ISO_FORMAT_STRING), + "created_at": datetime.datetime.utcnow().strftime(github_utils.ISO_FORMAT_STRING), "artifacts_url": "url", } @@ -73,7 +73,7 @@ class CheckRunTests(unittest.TestCase): # Set the creation time to well before the MAX_RUN_TIME # to guarantee the right conclusion kwargs["created_at"] = ( - datetime.datetime.now() - github_utils.MAX_RUN_TIME - datetime.timedelta(minutes=10) + datetime.datetime.utcnow() - github_utils.MAX_RUN_TIME - datetime.timedelta(minutes=10) ).strftime(github_utils.ISO_FORMAT_STRING) with self.assertRaises(github_utils.RunTimeoutError): |