https://github.com/travisjeffery/timecop
https://github.com/bebanjo/delorean
In the ruby community, disliking someone's choice of science fiction reference is grounds for a rewrite.
import freezegun; freezegun.monkey_patch()
from datetime import datetime
After that, freeze_time would just set a flag on your datetime class.Pure functions make tests simple.
Thanks
I've always used Mock http://www.voidspace.org.uk/python/mock/ to patch datetimes and I've never had any problems.
You can patch pretty much anything with Mock.