Exemplo n.º 1
0
 def test_validate_valid(self, m, n):
     with self.app.test_request_context('/login/'):
         ticket = '12345-abcdefg-cas'
         self.assertEqual(routing.validate(ticket), True)
         self.assertEqual(
             self.cas.username,
             'bob')
Exemplo n.º 2
0
 def test_validate_valid(self, m):
     with self.app.test_request_context('/login/'):
         ticket = '12345-abcdefg-cas'
         self.assertEqual(routing.validate(ticket), True)
         self.assertEqual(
             flask.session[self.app.config['CAS_USERNAME_SESSION_KEY']],
             'bob')
Exemplo n.º 3
0
 def test_validate_invalid(self, m, n):
     with self.app.test_request_context('/login/'):
         ticket = '12345-abcdefg-cas'
         self.assertEqual(routing.validate(ticket), False)
         self.assertTrue(self.app.config['CAS_USERNAME_SESSION_KEY'] not in
                         flask.session)
         self.assertTrue(self.app.config['CAS_ATTRIBUTES_SESSION_KEY']
                         not in flask.session)
         self.assertTrue(
             self.app.config['CAS_TOKEN_SESSION_KEY'] not in flask.session)
Exemplo n.º 4
0
 def test_validate_invalid(self, m, n):
     with self.app.test_request_context('/login/'):
         ticket = '12345-abcdefg-cas'
         self.assertEqual(routing.validate(ticket), False)
         self.assertTrue(
             self.app.config['CAS_USERNAME_SESSION_KEY'] not in flask.session)
         self.assertTrue(
             self.app.config['CAS_ATTRIBUTES_SESSION_KEY'] not in flask.session)
         self.assertTrue(
             self.app.config['CAS_TOKEN_SESSION_KEY'] not in flask.session)
Exemplo n.º 5
0
 def test_validate_valid(self, m):
     with self.app.test_client() as client:
         with self.app.test_request_context('/login/'):
             ticket = '12345-abcdefg-cas'
             self.assertEqual(routing.validate(ticket), True)
             self.assertEqual(
                 flask.session[self.app.config['CAS_USERNAME_SESSION_KEY']],
                 'bob')
             self.assertEqual(
                 flask.session[self.app.config['CAS_TOKEN_SESSION_KEY']],
                 ticket)
Exemplo n.º 6
0
 def test_validate_valid(self, m):
     with self.app.test_client() as client:
         with self.app.test_request_context('/login/'):
             ticket = '12345-abcdefg-cas'
             self.assertEqual(routing.validate(ticket), False)
Exemplo n.º 7
0
 def test_validate_valid(self, m, n):
     with self.app.test_request_context('/login/'):
         ticket = '12345-abcdefg-cas'
         self.assertEqual(routing.validate(ticket), True)
         self.assertEqual(self.cas.username, 'bob')
Exemplo n.º 8
0
 def test_validate_valid(self, m):
     with self.app.test_client() as client:
         with self.app.test_request_context('/login/'):
             ticket='12345-abcdefg-cas'
             self.assertEqual(routing.validate(ticket), False)