I have something like this:
As soon as the user subscribes (and will be in a waiting state until he confirms his email address), the session variable will be set like this: "FIRST_TIME_FREE_SESSION_EXPIRY_AGE_KEY" (sorry if this name seems confusing!), which will be set to datetime, adding 8 hours to the current time.
How this should affect the user, the user receives 8 hours of time to actually use all the functions of our site without confirming his email address to enter the system. After 8 hours, each view / page will display a large banner that will show the user a confirmation. (All this functionality is achieved with a single "provide_confirmed_user" decorator for each view).
I want to test the same functions using django unittest addon (class TestCase). How to do it?
Update. Do I need to manually update the specified value of the session variable (changed by 8 hours to several seconds) to do this? Or is there a better way there?
Update: this may seem insane, but I want to simulate a request from the future.
source
share