enh: setting timezone to utc

This commit is contained in:
Dineshkarthik 2019-08-06 16:30:13 +02:00
parent 2fb0bb8096
commit c49cbc679f
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ def _get_media_meta(media_obj: object, _type: str) -> Tuple[str, str]:
THIS_DIR,
_type,
"voice_{}.{}".format(
dt.fromtimestamp(media_obj.date).isoformat(), file_format
dt.utcfromtimestamp(media_obj.date).isoformat(), file_format
),
)
elif _type == "photo":

View file

@ -85,7 +85,7 @@ class MockClient:
def download_media(self, *args, **kwargs):
assert "AwADBQADbwAD2oTRVeHe5eXRFftfAg", args[0]
assert "/root/project/voice/voice_2019-07-25T16:53:50.ogg", kwargs[
assert "/root/project/voice/voice_2019-07-25T14:53:50.ogg", kwargs[
"file_name"
]
return kwargs["file_name"]
@ -108,7 +108,7 @@ class MediaDownloaderTestCase(unittest.TestCase):
self.assertEqual(
(
"AwADBQADbwAD2oTRVeHe5eXRFftfAg",
"/root/project/voice/voice_2019-07-25T16:53:50.ogg",
"/root/project/voice/voice_2019-07-25T14:53:50.ogg",
),
result,
)