mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-26 05:51:29 +00:00
test(common): add forced utc times for tests
This commit is contained in:
parent
73a847f288
commit
4d893d56b2
|
@ -11,6 +11,10 @@ def five_minutes_into_future_naive():
|
||||||
return datetime.now() + timedelta(minutes=5)
|
return datetime.now() + timedelta(minutes=5)
|
||||||
|
|
||||||
|
|
||||||
|
def five_minutes_into_future_naive_utc():
|
||||||
|
return datetime.utcnow() + timedelta(minutes=5)
|
||||||
|
|
||||||
|
|
||||||
def five_minutes_into_future():
|
def five_minutes_into_future():
|
||||||
return datetime.now(timezone.utc) + timedelta(minutes=5)
|
return datetime.now(timezone.utc) + timedelta(minutes=5)
|
||||||
|
|
||||||
|
@ -19,6 +23,10 @@ def five_minutes_into_past_naive():
|
||||||
return datetime.now() - timedelta(minutes=5)
|
return datetime.now() - timedelta(minutes=5)
|
||||||
|
|
||||||
|
|
||||||
|
def five_minutes_into_past_naive_utc():
|
||||||
|
return datetime.utcnow() - timedelta(minutes=5)
|
||||||
|
|
||||||
|
|
||||||
def five_minutes_into_past():
|
def five_minutes_into_past():
|
||||||
return datetime.now(timezone.utc) - timedelta(minutes=5)
|
return datetime.now(timezone.utc) - timedelta(minutes=5)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue