freezegun Questions
1
I've noticed this behaviour since at least 2015 and it hasn't changed since. When freezegun (or pytest-freezegun) is used to freeze time in a test, datetime.datetime.now() returns the frozen value ...
1
Solved
I have a test that seems to throw an odd error when freeze_time is called. Reading the stacktrace, it's most likely interacting with another dependency in an odd way, but I don't have enough experi...
2
I'm writing here a functional test to check if my API throttling is working as expected (will be rest at the beginning of every month).
Testing Class:
class ApiThrottlingTest(ThrottlingBaseTest...
Rozanne asked 1/2, 2017 at 13:39
2
Solved
simple model(models.py):
from django.db import models
class MyModel(models.Model):
start_date = models.DateField()
simple factory(test_factories.py):
from datetime import date
import factory
...
Headley asked 16/8, 2017 at 16:22
1
Solved
I'm attempting to use freezegun in my unit tests to patch a field in a dataclass that is set to the current date when the object is initialised. I would imagine the question is relevant to any atte...
Kerwon asked 16/4, 2020 at 18:41
1
I'm puzzled why a function that freezes time with freezegun outputs different UTC times depending on whether datetime.datetime.utcnow() is called, or datetime.datetime.now(pytz.utc). I'm not saying...
1
Solved
I am having a function with the a default value of a param as datetime.now(). method is something like below,
def as_standard_format(p_date=datetime.now(), fmt=sdk_constants.DEFAULT_DATE_TIME_FORM...
Venturesome asked 26/9, 2018 at 6:37
0
Im trying to use freezegun to set the clock back 10 seconds for a unit test.
I've found that setting the time to now with freezegun results in the expected behavior for datetime.datetime.now() but...
1
© 2022 - 2024 — McMap. All rights reserved.