Skip to content

Commit

Permalink
PR#10426-Addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaysawant committed Dec 14, 2022
1 parent 4fb6c84 commit 3ed7a1f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/foreman/api/test_contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,26 +1173,26 @@ 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 = target_sat.api.ContentView(server_config=cfg, id=content_view.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 3ed7a1f

Please sign in to comment.