Registration tests broken with regards to 'upgrades'
One-sentence description
The upgrade tests are broken due to poor date handling.
Current behaviour
Broken build.
Expected behaviour
Build works.
Steps to reproduce
./manage.py test
Suggested solution
Instead of mocking dates which is horribly complicated, use freezegun
to fix dates in a more reliable and readable way:
from freezegun import freeze_time
def test():
assert datetime.datetime.now() != datetime.datetime(2012, 1, 14)
with freeze_time("2012-01-14"):
assert datetime.datetime.now() == datetime.datetime(2012, 1, 14)
assert datetime.datetime.now() != datetime.datetime(2012, 1, 14)