'Calls SafeSessionMiddleware.process_response and verifies
the response.
Arguments:
set_request_user - If True, the user is set on the request
object.
set_session_cookie - If True, a session_id is set in the
session cookie in the response.'

def assert_response(self, set_request_user=False, set_session_cookie=False):

    if set_request_user:
        self.request.user = self.user
        SafeSessionMiddleware.set_user_id_in_session(self.request, self.user)
    if set_session_cookie:
        self.client.response.cookies[settings.SESSION_COOKIE_NAME] = 'some_session_id'
    response = SafeSessionMiddleware().process_response(self.request, self.client.response)
    self.assertEquals(response.status_code, 200)
