Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))