'Verifies success path.'

def verify_success(self):

    self.client.login(username=self.user.username, password='test')
    self.request.user = self.user
    session_id = self.client.session.session_key
    safe_cookie_data = SafeCookieData.create(session_id, self.user.id)
    self.request.COOKIES[settings.SESSION_COOKIE_NAME] = unicode(safe_cookie_data)
    with self.assert_not_logged():
        response = SafeSessionMiddleware().process_request(self.request)
    self.assertIsNone(response)
    self.assertEquals(self.request.safe_cookie_verified_user_id, self.user.id)
    self.cookies_from_request_to_response()
    with self.assert_not_logged():
        response = SafeSessionMiddleware().process_response(self.request, self.client.response)
    self.assertEquals(response.status_code, 200)
