Add domain admin grant test cases
This commit adds two test cases for domain administrator, specifically to check that they can add users and groups to their own domain. Change-Id: I0299d39dc8fca0e91acd277856aaf267bea50c1d
This commit is contained in:
parent
99733f172f
commit
3aacc4dfe7
|
@ -2160,6 +2160,20 @@ class DomainAdminTests(base_classes.TestCaseWithBootstrap,
|
|||
headers=self.headers
|
||||
)
|
||||
|
||||
def test_can_create_grant_for_user_own_domain_on_own_domain(self):
|
||||
user = PROVIDERS.identity_api.create_user(
|
||||
unit.new_user_ref(domain_id=self.domain_id)
|
||||
)
|
||||
|
||||
with self.test_client() as c:
|
||||
c.put(
|
||||
'/v3/domains/%s/users/%s/roles/%s' % (
|
||||
self.domain_id, user['id'],
|
||||
self.bootstrapper.reader_role_id
|
||||
),
|
||||
headers=self.headers
|
||||
)
|
||||
|
||||
def test_can_create_grant_for_group_on_project(self):
|
||||
group = PROVIDERS.identity_api.create_group(
|
||||
unit.new_group_ref(domain_id=self.domain_id)
|
||||
|
@ -2179,6 +2193,20 @@ class DomainAdminTests(base_classes.TestCaseWithBootstrap,
|
|||
headers=self.headers
|
||||
)
|
||||
|
||||
def test_can_create_grant_for_group_own_domain_on_own_domain(self):
|
||||
group = PROVIDERS.identity_api.create_group(
|
||||
unit.new_group_ref(domain_id=self.domain_id)
|
||||
)
|
||||
|
||||
with self.test_client() as c:
|
||||
c.put(
|
||||
'/v3/domains/%s/groups/%s/roles/%s' % (
|
||||
self.domain_id, group['id'],
|
||||
self.bootstrapper.reader_role_id
|
||||
),
|
||||
headers=self.headers
|
||||
)
|
||||
|
||||
def test_can_revoke_grant_from_user_on_project(self):
|
||||
user = PROVIDERS.identity_api.create_user(
|
||||
unit.new_user_ref(domain_id=self.domain_id)
|
||||
|
|
Loading…
Reference in New Issue