Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.13.z] using custom org for user timezone test #16278

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions tests/foreman/cli/test_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def test_negative_update_name(new_name, module_org, module_target_sat):


@pytest.mark.tier2
def test_positive_create_user_with_timezone(module_org, module_target_sat):
def test_positive_create_user_with_timezone(module_target_sat):
"""Create and remove user with valid timezone in an organization

:id: b9b92c00-ee99-4da2-84c5-0a576a862100
Expand All @@ -665,6 +665,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 @@ -674,10 +680,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']
Loading