"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/identity/test_backend_sql.py" between
keystone-17.0.0.tar.gz and keystone-18.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Victoria" series (latest release).

test_backend_sql.py  (keystone-17.0.0):test_backend_sql.py  (keystone-18.0.0)
skipping to change at line 340 skipping to change at line 340
user['enabled'] = False user['enabled'] = False
PROVIDERS.identity_api.update_user(user['id'], user) PROVIDERS.identity_api.update_user(user['id'], user)
user_ref = self._get_user_ref(user['id']) user_ref = self._get_user_ref(user['id'])
self.assertFalse(user_ref.enabled) self.assertFalse(user_ref.enabled)
# re-enable user and test # re-enable user and test
user['enabled'] = True user['enabled'] = True
PROVIDERS.identity_api.update_user(user['id'], user) PROVIDERS.identity_api.update_user(user['id'], user)
user_ref = self._get_user_ref(user['id']) user_ref = self._get_user_ref(user['id'])
self.assertTrue(user_ref.enabled) self.assertTrue(user_ref.enabled)
def test_ignore_user_inactivity(self):
self.user_dict['options'] = {'ignore_user_inactivity': True}
user = PROVIDERS.identity_api.create_user(
self.user_dict)
# set last_active_at just beyond the max
last_active_at = (
datetime.datetime.utcnow() -
datetime.timedelta(self.max_inactive_days + 1)).date()
self._update_user_last_active_at(user['id'], last_active_at)
# get user and verify that the user is not disabled
user = PROVIDERS.identity_api.get_user(user['id'])
self.assertTrue(user['enabled'])
def test_ignore_user_inactivity_with_user_disabled(self):
user = PROVIDERS.identity_api.create_user(
self.user_dict)
# set last_active_at just beyond the max
last_active_at = (
datetime.datetime.utcnow() -
datetime.timedelta(self.max_inactive_days + 1)).date()
self._update_user_last_active_at(user['id'], last_active_at)
# get user and verify that the user is disabled
user = PROVIDERS.identity_api.get_user(user['id'])
self.assertFalse(user['enabled'])
# update disabled user with ignore_user_inactivity to true
user['options'] = {'ignore_user_inactivity': True}
user = PROVIDERS.identity_api.update_user(
user['id'], user)
# user is not enabled
user = PROVIDERS.identity_api.get_user(user['id'])
self.assertFalse(user['enabled'])
# Manually set enabled and test
user['enabled'] = True
PROVIDERS.identity_api.update_user(user['id'], user)
user = PROVIDERS.identity_api.get_user(user['id'])
self.assertTrue(user['enabled'])
def _get_user_dict(self, password): def _get_user_dict(self, password):
user = { user = {
'name': uuid.uuid4().hex, 'name': uuid.uuid4().hex,
'domain_id': CONF.identity.default_domain_id, 'domain_id': CONF.identity.default_domain_id,
'enabled': True, 'enabled': True,
'password': password 'password': password
} }
return user return user
def _get_user_ref(self, user_id): def _get_user_ref(self, user_id):
 End of changes. 1 change blocks. 
0 lines changed or deleted 37 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)