diff --git a/requirements_dev.txt b/requirements_dev.txt index 21fc6ec..d21b604 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -2,4 +2,5 @@ numpy orjson pytest python-dateutil +time-machine typing_extensions diff --git a/tests/test_neofoodclub.py b/tests/test_neofoodclub.py index e10d11e..896039d 100644 --- a/tests/test_neofoodclub.py +++ b/tests/test_neofoodclub.py @@ -2,6 +2,8 @@ from typing import Any, Dict, Optional import pytest +import time_machine +from dateutil.tz import tzutc from neofoodclub import Modifier, NeoFoodClub from neofoodclub.errors import InvalidData @@ -220,6 +222,11 @@ def test_outdated_lock(nfc: NeoFoodClub) -> None: assert nfc.is_outdated_lock is True +@time_machine.travel(datetime.datetime(2021, 2, 16, 12, 0, 0, 0, tzinfo=tzutc())) +def test_outdated_lock_false(nfc: NeoFoodClub) -> None: + assert nfc.is_outdated_lock is False + + def test_outdated_lock_none(nfc: NeoFoodClub) -> None: data = nfc.to_dict()