# Pastebin MR6u9g0X def test_password_change_with_pool(self): old_password = self.user_sna['password'] self.cleanup_pools() # authenticate so that connection is added to pool before password # change user_ref = self.identity_api.authenticate( self.make_request(), user_id=self.user_sna['id'], password=self.user_sna['password']) self.user_sna.pop('password') self.user_sna['enabled'] = True self.assertDictEqual(self.user_sna, user_ref) new_password = 'new_password' user_ref['password'] = new_password self.identity_api.update_user(user_ref['id'], user_ref) # now authenticate again to make sure new password works with # connection pool user_ref2 = self.identity_api.authenticate( self.make_request(), user_id=self.user_sna['id'], password=new_password) user_ref.pop('password') self.assertDictEqual(user_ref, user_ref2) # Authentication with old password would not work here as there # is only one connection in pool which get bind again with updated # password..so no old bind is maintained in this case. self.assertRaises(AssertionError, self.identity_api.authenticate, self.make_request(), user_id=self.user_sna['id'], password=old_password)