I was thinking about how to achieve it some days ago. There's a method that uses today's date to choose which transactions should be returned and I have no idea how to mock this!
Well, after some research, here it is:
views.py
tests.py
Pay attention to mock.patch, we're overriding datetime module only inside of views.py!
Hi there! Are you enjoying what you're
reading? If you do, you can be the first to know when I post cool stuff!