From d19b7185d8d92a0338352b2c2169a9c3bd339ee8 Mon Sep 17 00:00:00 2001 From: halcy Date: Fri, 18 Nov 2022 00:06:24 +0200 Subject: try to fix tests, again --- tests/test_timeline.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/test_timeline.py') diff --git a/tests/test_timeline.py b/tests/test_timeline.py index 85026f6..14b7703 100644 --- a/tests/test_timeline.py +++ b/tests/test_timeline.py @@ -85,10 +85,13 @@ def test_min_max_id_datetimes(api, status): the_past = data_dict["the_past"] the_future = data_dict["the_future"] the_far_future = data_dict["the_far_future"] + print("restoring from dict\n", the_past, the_future, the_far_future) else: - the_past = datetime.datetime.now() - datetime.timedelta(seconds=20) - the_future = datetime.datetime.now() + datetime.timedelta(seconds=20) - the_far_future = datetime.datetime.now() + datetime.timedelta(seconds=40) + epoch_time = datetime.datetime.now().timestamp() + now = datetime.datetime.fromtimestamp(epoch_time) + the_past = now - datetime.timedelta(seconds=20) + the_future = now + datetime.timedelta(seconds=20) + the_far_future = now + datetime.timedelta(seconds=40) pickle.dump({ "the_past": the_past, "the_future": the_future, -- cgit v1.2.3