I think a better way to mock this (in the future, don't change it now), is to just have a function that wraps datetime.now() that application code calls, and that can be mocked out easily. But maybe I'm missing your use case.