def test_check_request_logged_in_valid_post(self): os.environ['HTTP_COOKIE'] = 'auth=%s' % self.auth_token os.environ['REQUEST_URI'] = '/cgi-bin/routerapi/dashboard' os.environ['REQUEST_METHOD'] = 'POST' os.environ['HTTP_X_CSRF_TOKEN'] = self.auth.get_csrf_token() # Should not exit self.assertTrue(auth.check_request(self.path))
def test_check_request_logged_in_valid_post(self): os.environ["HTTP_COOKIE"] = "auth=%s" % self.auth_token os.environ["REQUEST_URI"] = "/cgi-bin/routerapi/dashboard" os.environ["REQUEST_METHOD"] = "POST" os.environ["HTTP_X_CSRF_TOKEN"] = self.auth.get_csrf_token() # Should not exit self.assertTrue(auth.check_request(self.path))
def test_check_request_logged_out(self): os.environ['REQUEST_URI'] = '/cgi-bin/routerapi/login' # Should not exit self.assertTrue(auth.check_request(self.path))
def test_check_request_logged_in(self): os.environ['HTTP_COOKIE'] = 'auth=%s' % self.auth_token os.environ['REQUEST_URI'] = '/cgi-bin/routerapi/dashboard' # Should not exit self.assertTrue(auth.check_request(self.path))
def test_check_request_logged_in(self): os.environ["HTTP_COOKIE"] = "auth=%s" % self.auth_token os.environ["REQUEST_URI"] = "/cgi-bin/routerapi/dashboard" # Should not exit self.assertTrue(auth.check_request(self.path))