Skip to content

Commit

Permalink
fixes in api role helper functions (#13849)
Browse files Browse the repository at this point in the history
paramter order in api role helper functions

(cherry picked from commit b588165)
  • Loading branch information
pondrejk authored and web-flow committed Jan 23, 2024
1 parent 8501055 commit 4056a13
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/foreman/api/test_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def test_negative_access_entities_from_org_admin(
target_sat, role_taxos=role_taxonomies, user_taxos=filter_taxonomies
)
domain = self.create_domain(
orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
sc = self.user_config(user, target_sat)
# Getting the domain from user
Expand Down Expand Up @@ -608,7 +608,7 @@ def test_negative_access_entities_from_user(
target_sat, role_taxos=role_taxonomies, user_taxos=filter_taxonomies
)
domain = self.create_domain(
orgs=[filter_taxonomies['org'].id], locs=[filter_taxonomies['loc'].id]
target_sat, orgs=[filter_taxonomies['org'].id], locs=[filter_taxonomies['loc'].id]
)
sc = self.user_config(user, target_sat)
# Getting the domain from user
Expand Down Expand Up @@ -1074,7 +1074,9 @@ def test_negative_assign_org_admin_to_user_group(
name=ug_name, role=[org_admin.id], user=[user_one.id, user_two.id]
).create()
assert user_group.name == ug_name
dom = self.create_domain(orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id])
dom = self.create_domain(
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
for user in [user_one, user_two]:
sc = self.user_config(user, target_sat)
with pytest.raises(HTTPError):
Expand Down Expand Up @@ -1447,7 +1449,7 @@ def test_positive_access_users_inside_org_admin_taxonomies(self, role_taxonomies
user = self.create_org_admin_user(
target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies
)
test_user = self.create_simple_user(filter_taxos=role_taxonomies)
test_user = self.create_simple_user(target_sat, filter_taxos=role_taxonomies)
sc = self.user_config(user, target_sat)
try:
target_sat.api.User(sc, id=test_user.id).read()
Expand Down Expand Up @@ -1519,7 +1521,7 @@ def test_negative_access_users_outside_org_admin_taxonomies(
user = self.create_org_admin_user(
target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies
)
test_user = self.create_simple_user(filter_taxos=filter_taxonomies)
test_user = self.create_simple_user(target_sat, filter_taxos=filter_taxonomies)
sc = self.user_config(user, target_sat)
with pytest.raises(HTTPError):
target_sat.api.User(sc, id=test_user.id).read()
Expand Down Expand Up @@ -1646,7 +1648,7 @@ def test_negative_access_entities_from_ldap_org_admin(
)
# Creating Domain resource in same taxonomies as Org Admin role to access later
domain = self.create_domain(
orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
sc = ServerConfig(
auth=(create_ldap['ldap_user_name'], create_ldap['ldap_user_passwd']),
Expand Down Expand Up @@ -1690,7 +1692,7 @@ def test_negative_access_entities_from_ldap_user(
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
# Creating Domain resource in different taxonomies to access later
domain = self.create_domain(orgs=[module_org.id], locs=[module_location.id])
domain = self.create_domain(target_sat, orgs=[module_org.id], locs=[module_location.id])
sc = ServerConfig(
auth=(create_ldap['ldap_user_name'], create_ldap['ldap_user_passwd']),
url=create_ldap['sat_url'],
Expand Down Expand Up @@ -1739,6 +1741,7 @@ def test_positive_assign_org_admin_to_ldap_user_group(
)
# Creating Domain resource in same taxonomies as Org Admin role to access later
domain = self.create_domain(
target_sat,
orgs=[create_ldap['authsource'].organization[0].id],
locs=[create_ldap['authsource'].location[0].id],
)
Expand Down Expand Up @@ -1798,7 +1801,7 @@ def test_negative_assign_org_admin_to_ldap_user_group(
)
# Creating Domain resource in same taxonomies as Org Admin role to access later
domain = self.create_domain(
orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
users = [
target_sat.api.User(
Expand Down

0 comments on commit 4056a13

Please sign in to comment.