Alternatively you could create instances of the AuthenticationMiddleware, SessionMiddleware, and middleware for messages and run it on the request. That way if the way these work changes in a future version of Django this test won't break.