From c122f1531f03b16316fd8532cffd92f65705d56b Mon Sep 17 00:00:00 2001 From: halcy Date: Fri, 18 Nov 2022 00:19:17 +0200 Subject: Maybe fix test TZ issues --- tests/test_status.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_status.py') diff --git a/tests/test_status.py b/tests/test_status.py index f45634f..5c139e6 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -176,10 +176,10 @@ def test_scheduled_status(api): assert not scheduled_toot_2.id in map(lambda x: x.id, scheduled_toot_list_2) if os.path.exists("tests/cassettes/test_scheduled_status_datetimeobjects.pkl"): - the_very_immediate_future = pickle.load(open("tests/cassettes/test_scheduled_status_datetimeobjects.pkl", 'rb')) + the_very_immediate_future = datetime.datetime.fromtimestamp(pickle.load(open("tests/cassettes/test_scheduled_status_datetimeobjects.pkl", 'rb'))) else: the_very_immediate_future = datetime.datetime.now() + datetime.timedelta(seconds=5) - pickle.dump(the_very_immediate_future, open("tests/cassettes/test_scheduled_status_datetimeobjects.pkl", 'wb')) + pickle.dump(the_very_immediate_future.timestamp(), open("tests/cassettes/test_scheduled_status_datetimeobjects.pkl", 'wb')) scheduled_toot_4 = api.status_post("please ensure adequate headroom", scheduled_at=the_very_immediate_future) time.sleep(15) statuses = api.timeline_home() -- cgit v1.2.3