Skip to content

Commit

Permalink
PR#10426-Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaysawant committed Jan 30, 2023
1 parent face3c5 commit 22a1fd6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/foreman/api/test_contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,26 +1173,27 @@ def test_negative_readonly_user_actions(
with pytest.raises(HTTPError):
target_sat.api.ContentView(server_config=cfg, organization=module_org).create()
# Check that we can read our content view with custom user
content_view = target_sat.api.ContentView(server_config=cfg, id=content_view.id)
content_view_readonly_user = target_sat.api.ContentView(server_config=cfg, id=content_view.id)
# Check that we cannot modify content view with custom user
with pytest.raises(HTTPError):
target_sat.api.ContentView(
server_config=cfg, id=content_view.id, name=gen_string('alpha')
).update(['name'])
# Check that we cannot delete content view due read-only permission
with pytest.raises(HTTPError):
content_view.delete()
content_view_readonly_user.delete()
# Check that we cannot publish content view
with pytest.raises(HTTPError):
content_view.publish()
content_view_readonly_user.publish()
# Check that we cannot promote content view
content_view = target_sat.api.ContentView(id=content_view.id)
content_view.publish()
content_view = target_sat.api.ContentView(server_config=cfg, id=content_view.id).read()
assert len(content_view.version), 1
with pytest.raises(HTTPError):
content_view = target_sat.api.ContentView(server_config=cfg, id=content_view.id)
content_view.read().version[0].promote(data={'environment_ids': module_lce.id})
content_view_readonly_user.read().version[0].promote(
data={'environment_ids': module_lce.id}
)
# Check that we cannot create a Product
with pytest.raises(HTTPError):
target_sat.api.Product(server_config=cfg).create()
Expand Down

0 comments on commit 22a1fd6

Please sign in to comment.