Skip to content

Commit 905e74b

Browse files
authored
Use unix timestamp in meta endpoint (#1440)
* fix: use unix timestamp
1 parent e36f467 commit 905e74b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pokemon_v2/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ def list(self, request):
10911091
try:
10921092
deploy_date = (
10931093
subprocess.check_output(
1094-
["git", "log", "-1", "--format=%cI"], stderr=subprocess.DEVNULL
1094+
["git", "log", "-1", "--format=%ct"], stderr=subprocess.DEVNULL
10951095
)
10961096
.decode()
10971097
.strip()

pokemon_v2/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5861,7 +5861,7 @@ def test_case_insensitive_api(self):
58615861
def test_meta_api(self):
58625862
response = self.client.get("{}/meta/".format(API_V2))
58635863
self.assertEqual(response.status_code, status.HTTP_200_OK)
5864-
self.assertTrue(datetime.fromisoformat(response.data["deploy_date"]))
5865-
self.assertEqual(25, len(response.data["deploy_date"]))
5864+
self.assertTrue(datetime.fromtimestamp(int(response.data["deploy_date"])))
5865+
self.assertEqual(10, len(response.data["deploy_date"]))
58665866
self.assertEqual(40, len(response.data["hash"]))
58675867
self.assertIn("tag", response.data)

0 commit comments

Comments
 (0)