From eaa745903d00facdd1deb00982180f30aee900bf Mon Sep 17 00:00:00 2001 From: Ashish Patil Date: Sun, 11 Feb 2024 11:19:44 +0400 Subject: [PATCH] ++TickingDateTimeFactory.move_to added missing move_to, resolves https://github.com/spulec/freezegun/issues/350 --- freezegun/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/freezegun/api.py b/freezegun/api.py index 2917fa1f..090d3c5b 100644 --- a/freezegun/api.py +++ b/freezegun/api.py @@ -493,6 +493,10 @@ def __init__(self, time_to_freeze, start): def __call__(self): return self.time_to_freeze + (real_datetime.now() - self.start) + def move_to(self, target_datetime): + """Moves frozen date to the given ``target_datetime``""" + self.time_to_freeze = _parse_time_to_freeze(target_datetime) + class FrozenDateTimeFactory: