Mocking datetime.datetime.now
Once in a while, I have to write unit tests for methods that call datetime.datetime.now and I want that call to return a predictable result. The solution: make datetime.datetime.now to return what you want it to return. As I have used many different approaches over time...