1
1
import os
2
2
import json
3
- import pytz
4
3
import random
5
4
import os .path
6
5
import unittest
14
13
DirectThread , DirectMessage , Usertag , Location , Account ,
15
14
Hashtag
16
15
)
16
+ from instagrapi .zones import UTC
17
17
18
18
19
19
ACCOUNT_USERNAME = os .environ .get ("IG_USERNAME" , "instagrapi2" )
@@ -403,7 +403,7 @@ def test_media_comments(self):
403
403
404
404
def test_media_comment (self ):
405
405
text = "Test text [%s]" % datetime .now ().strftime ("%s" )
406
- now = datetime .now (tz = pytz . UTC )
406
+ now = datetime .now (tz = UTC () )
407
407
comment = self .api .media_comment (2276404890775267248 , text )
408
408
self .assertIsInstance (comment , Comment )
409
409
comment = comment .dict ()
@@ -536,7 +536,7 @@ def test_extract_media_photo(self):
536
536
"pk" : 2154602296692269830 ,
537
537
"code" : "B3mr1-OlWMG" ,
538
538
"media_type" : 1 ,
539
- "taken_at" : datetime (2019 , 10 , 14 , 15 , 57 , 10 , tzinfo = pytz . UTC )
539
+ "taken_at" : datetime (2019 , 10 , 14 , 15 , 57 , 10 , tzinfo = UTC () )
540
540
}.items ():
541
541
if isinstance (val , str ):
542
542
self .assertTrue (getattr (media , key ).startswith (val ))
@@ -562,7 +562,7 @@ def test_extract_media_video(self):
562
562
"video_url" : "https://" ,
563
563
"thumbnail_url" : "https://" ,
564
564
"media_type" : 2 ,
565
- "taken_at" : datetime (2018 , 3 , 13 , 14 , 59 , 23 , tzinfo = pytz . UTC )
565
+ "taken_at" : datetime (2018 , 3 , 13 , 14 , 59 , 23 , tzinfo = UTC () )
566
566
}.items ():
567
567
if isinstance (val , str ):
568
568
self .assertTrue (getattr (media , key ).startswith (val ))
@@ -587,7 +587,7 @@ def test_extract_media_album(self):
587
587
"pk" : 1787135824035452364 ,
588
588
"code" : "BjNLpA1AhXM" ,
589
589
"media_type" : 8 ,
590
- "taken_at" : datetime (2018 , 5 , 25 , 15 , 46 , 53 , tzinfo = pytz . UTC ),
590
+ "taken_at" : datetime (2018 , 5 , 25 , 15 , 46 , 53 , tzinfo = UTC () ),
591
591
"product_type" : "" ,
592
592
}.items ():
593
593
self .assertEqual (getattr (media , key ), val )
@@ -632,7 +632,7 @@ def test_extract_media_igtv(self):
632
632
"thumbnail_url" : "https://" ,
633
633
"code" : "ByYn5ZNlHWf" ,
634
634
"media_type" : 2 ,
635
- "taken_at" : datetime (2019 , 6 , 6 , 22 , 22 , 6 , tzinfo = pytz . UTC ),
635
+ "taken_at" : datetime (2019 , 6 , 6 , 22 , 22 , 6 , tzinfo = UTC () ),
636
636
"product_type" : "igtv" ,
637
637
}.items ():
638
638
if isinstance (val , str ):
0 commit comments