Skip to content

Commit

Permalink
Expect exception instead of false return value (#12508)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhellebr authored Sep 6, 2023
1 parent 87c1c92 commit af79e0c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/foreman/ui/test_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ def test_positive_end_to_end(session):
)
assert session.organization.search(new_name)
org_values = session.organization.read(new_name, widget_names=widget_list)
assert not session.organization.delete(new_name)
with pytest.raises(AssertionError) as context:
assert not session.organization.delete(new_name)
assert (
'The current organization cannot be deleted. Please switch to a '
'different organization before deleting.' in str(context.value)
)
assert user.login in org_values['users']['resources']['assigned']
assert media.name in org_values['media']['resources']['assigned']
assert template.name in org_values['provisioning_templates']['resources']['assigned']
Expand Down

0 comments on commit af79e0c

Please sign in to comment.