I've written an auction system in Django. I want to write unit tests but the application is time sensitive (e.g. the amount advertisers are charged is a function of how long their ad has been active on a website). What's a good approach for testing this type of application?
Here's one possible solution: a DateFactory class which provides some methods to generate a predictable date in testing and the realtime value in production. Do you have any thoughts on this approach, or have you tried something else in practice?