Exemplo n.º 1
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(
             self.cas.username,
             'bob')
Exemplo n.º 2
0
 def test_validate_invalid(self, m):
     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_TOKEN_SESSION_KEY'] not in flask.session)
Exemplo n.º 3
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(
             self.cas.username,
             'bob')
         self.assertEqual(
             self.cas.attributes,
             {'firstname': 'John',
              'lastname': 'Doe',
              'title': 'Mr.',
              'email': '*****@*****.**',
              'affiliation': ['staff', 'faculty']})
Exemplo n.º 4
0
 def test_attributes_missing_from_cas_validation_response(self, m, n):
     with self.app.test_request_context('/login/'):
         ticket = '12345-abcdefg-cas'
         self.assertEqual(routing.validate(ticket), True)