How to Mock the Current Date and Time in Python by Adam Johnson

Dec. 24, 2020 | Articles
If you’re testing Python code that relies on the current date or time, you will probably want to mock time to test different scenarios but doing so isn't that easy. Adam Johnson shares some tips on how to overcome this.
URL: https://adamj.eu/tech/2020/12/20/how-to-mock-the-current-date-and-time-in-python/
Filed in: Articles

Sponsor Number One

Subscribe to Django News

Weekly Django news, articles, projects, and more. Curated by Jeff Triplett & William Vincent.

No spam, ever. We'll never share your email address and you can opt out at any time.