From 5f7cf22581a82445137ff3c3c29a7d84247609da Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Fri, 6 Sep 2024 14:18:21 +0200 Subject: [PATCH] using custom org for timezone test --- tests/foreman/cli/test_organization.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/foreman/cli/test_organization.py b/tests/foreman/cli/test_organization.py index eded57e07ef..f86286c28d1 100644 --- a/tests/foreman/cli/test_organization.py +++ b/tests/foreman/cli/test_organization.py @@ -672,6 +672,12 @@ def test_positive_create_user_with_timezone(module_org, module_target_sat): :expectedresults: User created and removed successfully with valid timezone """ + name = valid_org_names_list()[0] + label = valid_labels_list()[0] + desc = list(valid_data_list().values())[0] + org = module_target_sat.cli_factory.make_org( + {'name': name, 'label': label, 'description': desc} + ) users_timezones = [ 'Pacific Time (US & Canada)', 'International Date Line West', @@ -681,10 +687,10 @@ def test_positive_create_user_with_timezone(module_org, module_target_sat): ] for timezone in users_timezones: user = module_target_sat.cli_factory.user({'timezone': timezone, 'admin': '1'}) - module_target_sat.cli.Org.add_user({'name': module_org.name, 'user': user['login']}) - org_info = module_target_sat.cli.Org.info({'name': module_org.name}) + module_target_sat.cli.Org.add_user({'name': org.name, 'user': user['login']}) + org_info = module_target_sat.cli.Org.info({'name': org.name}) assert user['login'] in org_info['users'] assert user['timezone'] == timezone - module_target_sat.cli.Org.remove_user({'id': module_org.id, 'user-id': user['id']}) - org_info = module_target_sat.cli.Org.info({'name': module_org.name}) + module_target_sat.cli.Org.remove_user({'id': org.id, 'user-id': user['id']}) + org_info = module_target_sat.cli.Org.info({'name': org.name}) assert user['login'] not in org_info['users']