Best Python code snippet using tempest_python
test_users.py
Source:test_users.py
...131 self.assertEqual(user['id'], fetched_user['id'])132 @testtools.skipUnless(CONF.identity_feature_enabled.security_compliance,133 'Security compliance not available.')134 @decorators.idempotent_id('568cd46c-ee6c-4ab4-a33a-d3791931979e')135 def test_password_history_not_enforced_in_admin_reset(self):136 old_password = self.os_primary.credentials.password137 user_id = self.os_primary.credentials.user_id138 new_password = data_utils.rand_password()139 self.users_client.update_user(user_id, password=new_password)140 # To be safe, we add this cleanup to restore the original password in141 # case something goes wrong before it is restored later.142 self.addCleanup(143 self.users_client.update_user, user_id, password=old_password)144 # Check authorization with new password145 self.token.auth(user_id=user_id, password=new_password)146 if CONF.identity.user_unique_last_password_count > 1:147 # The password history is not enforced via the admin reset route.148 # We can set the same password.149 self.users_client.update_user(user_id, password=new_password)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!