-
Notifications
You must be signed in to change notification settings - Fork 165
[1LP][RFR] Test to create group #10134
[1LP][RFR] Test to create group #10134
Conversation
I detected some fixture changes in commit a95929c3858498d483d33851a077e9626b3c3d17 The local fixture
Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃 |
a95929c
to
d4ec643
Compare
@request.addfinalizer | ||
def _cleanup(): | ||
if cg.exists: | ||
cg.delete() | ||
if group.exists: | ||
group.delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather add these deletion statements right after the creation statements.
something like -
cg = ....
request.addfinalizer(cg.delete_if_exists)
group = ....
request.addfinalizer(group.delete_if_exists)
On a second thought, you can simply use cg.delete
and group.delete
since there are no other destructive operations performed on either of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@valaparthvi @dgaikwad
The BaseEntity
class actually has a delete_if_exists
method that was written for just such a scenario, please use it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use delete_if_exists
, optionally in a request.addfinalizer
call.
d4ec643
to
56755ea
Compare
adding_test test to create group if at least one category show_in_console value is No
Purpose or Intent
PRT Run
{{pytest: cfme/tests/configure/test_access_control.py -k "test_create_group_console_no" --long-running -v}}