From 114ce65d77360f03d158eaad2070872159669dc8 Mon Sep 17 00:00:00 2001 From: amol patil Date: Fri, 29 Nov 2024 16:39:19 +0530 Subject: [PATCH] remove user to prevent ForeignKeyViolation --- tests/foreman/api/test_ansible.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/foreman/api/test_ansible.py b/tests/foreman/api/test_ansible.py index 9cea42bab82..e206e65eb62 100644 --- a/tests/foreman/api/test_ansible.py +++ b/tests/foreman/api/test_ansible.py @@ -21,7 +21,7 @@ @pytest.fixture -def filtered_user(target_sat, module_org, module_location): +def filtered_user(request, target_sat, module_org, module_location): """ :steps: 1. Create a role with a host view filtered @@ -48,7 +48,7 @@ def filtered_user(target_sat, module_org, module_location): user = target_sat.api.User( role=[role], password=password, location=[module_location], organization=[module_org] ).create() - + request.addfinalizer(user.delete) return user, password