I would like to read some session variables from a test (Django TestCase)
How to do that in a clean way ?
def test_add_docs(self):
\"\"\"
Tes
If you need to initialize a session for the request in tests to manipulate it directly:
from django.contrib.sessions.middleware import SessionMiddleware
from django.http import HttpRequest
request = HttpRequest()
middleware = SessionMiddleware()
middleware.process_request(request)
request.session.save()