Skip to content

Commit

Permalink
test syncplan creation with custom timezone (#15120)
Browse files Browse the repository at this point in the history
(cherry picked from commit 27b3e06)
  • Loading branch information
pondrejk authored and web-flow committed May 23, 2024
1 parent 942ac3f commit 0e524e4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/foreman/cli/test_syncplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,38 @@ def test_positive_update_sync_date(module_org, request, target_sat):
), 'Sync date was not updated'


@pytest.mark.tier1
@pytest.mark.upgrade
def test_positive_create_sync_date_custom_timezone(module_org, request, target_sat):
"""Check if syncplan sync date accepts supplied timezone
:id: 9b5f421d-b925-4ea6-9000-e69ed5e35640
:expectedresults: Sync plan is created with correct start date
:BZ: 2015344
:customerscenario: true
:CaseImportance: High
"""
future_date = datetime.now() + timedelta(days=5)
format = '%Y-%m-%d %H:%M:%S CEST'
sync_plan_name = gen_string('alphanumeric')
new_sync_plan = target_sat.cli_factory.sync_plan(
{
'name': sync_plan_name,
'sync-date': future_date.strftime(format),
'organization-id': module_org.id,
}
)
sync_plan = target_sat.api.SyncPlan(organization=module_org.id, id=new_sync_plan['id']).read()
request.addfinalizer(lambda: target_sat.api_factory.disable_syncplan(sync_plan))
expected_date = future_date + timedelta(hours=4)
# Assert that sync date was converted to UTC correctly
assert new_sync_plan['start-date'] == expected_date.strftime("%Y/%m/%d %H:%M:%S")


@pytest.mark.parametrize('name', **parametrized(valid_data_list()))
@pytest.mark.tier1
@pytest.mark.upgrade
Expand Down

0 comments on commit 0e524e4

Please sign in to comment.