def test_session_timeout(self):
        requested_url = '/project/instances/'
        request = self.factory.get(requested_url)
        try:
            timeout = settings.SESSION_TIMEOUT
        except __HOLE__:
            timeout = 1800
        request.session['last_activity'] = int(time.time()) - (timeout + 10)
        mw = middleware.HorizonMiddleware()
        resp = mw.process_request(request)
        self.assertEqual(302, resp.status_code)
        self.assertEqual(requested_url, resp.get('Location'))
dataset/ETHPy150Open CiscoSystems/avos/horizon/test/tests/middleware.py/MiddlewareTests.test_session_timeout