Beispiel #1
0
 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))
Beispiel #2
0
 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))
Beispiel #3
0
 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))
Beispiel #4
0
 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))
Beispiel #5
0
 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))
Beispiel #6
0
 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))
Beispiel #7
0
 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))
Beispiel #8
0
 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))