Beispiel #1
0
 def test_successful_fed_login(self):
     user = RpcUser()
     user.fed_id = self.config.get('Test Visitor', 'fed_id')
     user.name = self.config.get('Test Visitor', 'user_name')
     user.auth_system = RpcService()
     user.auth_system.site_name = self.config.get('My Test Vista', 'site_name')
     user.auth_system.site_id = self.config.get('My Test Vista', 'site_id')
     user.uid = self.config.get('Test Visitor', 'uid')
     self.cxn.connect()
     self.assertTrue(self.cxn.is_connected)
     uid, greeting = user.fed_login(self.cxn)
     self.cxn.disconnect()
     self.assertEqual('33', uid)
     self.assertEqual('OK', greeting)
Beispiel #2
0
    def testHasFederatedCredentials(self):
        user = RpcUser()
        self.assertFalse(user.has_federated_credentials())

        user.auth_system = RpcService()
        user.auth_system.site_id = 1
        self.assertFalse(user.has_federated_credentials())

        user.auth_system.site_name = 'the_site_name'
        self.assertFalse(user.has_federated_credentials())

        user.fed_id = '123456789'
        self.assertFalse(user.has_federated_credentials())

        user.name = 'SomeName'
        self.assertFalse(user.has_federated_credentials())

        user.uid = '31'
        self.assertTrue(user.has_federated_credentials())