Skip to content

Commit

Permalink
using custom org for timezone test
Browse files Browse the repository at this point in the history
  • Loading branch information
pondrejk committed Sep 6, 2024
1 parent 6675041 commit 5f7cf22
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/foreman/cli/test_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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']

0 comments on commit 5f7cf22

Please sign in to comment.