I have a unittest which access an internal api and which sets value in session.
eg.
def api_work(request):
request.session['stuff'] = True
Now for me to test it:
def test_api(self):
self.client.get(/api_work/)
# self.client.session is empty dictionary
My question is if it's possible to use library like MagicMock to make self.client.session shadow the request.session?