Create users in the same domain for test_list_users_with_not_enabled
when user is created w/o explicitly specifying domain,
it is always created in the 'default' domain.
Hence this test was only working if the 'admin' user
is in the default domain as well, and breaks if the user is
authorized in some other domain (even with admin role).
Change-Id: I8fa66267727641c97f2f6b86904ccde601e7d7fe
Closes-Issue: PRODX-32677
diff --git a/tempest/api/identity/admin/v3/test_list_users.py b/tempest/api/identity/admin/v3/test_list_users.py
index 7bd0bcf..c114277 100644
--- a/tempest/api/identity/admin/v3/test_list_users.py
+++ b/tempest/api/identity/admin/v3/test_list_users.py
@@ -30,7 +30,7 @@
# expected: user expected in the list response
# not_expected: user, which should not be present in list response
body = self.users_client.list_users(**params)['users']
- self.assertIn(expected[key], map(lambda x: x[key], body))
+ self.assertIn(expected[key], list(map(lambda x: x[key], body)))
self.assertNotIn(not_expected[key],
map(lambda x: x[key], body))
@@ -79,9 +79,18 @@
@decorators.idempotent_id('bff8bf2f-9408-4ef5-b63a-753c8c2124eb')
def test_list_users_with_not_enabled(self):
"""List the users with not enabled"""
- params = {'enabled': False}
+ domain_disabled_user = self.users_client.create_user(
+ name=data_utils.rand_name('test_user'),
+ password=data_utils.rand_password(),
+ domain_id=self.domain['id'],
+ email=self.alt_email,
+ enabled=False,
+ )['user']
+ self.addCleanup(self.users_client.delete_user,
+ domain_disabled_user['id'])
+ params = {'enabled': False, "domain_id": self.domain["id"]}
self._list_users_with_params(params, 'enabled',
- self.non_domain_enabled_user,
+ domain_disabled_user,
self.domain_enabled_user)
@decorators.idempotent_id('c285bb37-7325-4c02-bff3-3da5d946d683')