Skip to content

Commit

Permalink
UTC timezone used for CI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Feb 27, 2025
1 parent eb9f5e6 commit 88f46ea
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/foreman/api/test_reporttemplates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ def test_positive_applied_errata_by_install_date(
):
"""Generate two Applied Errata reports, for Today and Yesterday,
specifying the SINCE and UP-TO date fields, when the erratum
were installed (local time).
were installed (UTC for CI testing).
:id: 33f5abfd-16dd-4f2e-a9c2-c1ce3aaa33d6
Expand Down Expand Up @@ -1187,15 +1187,15 @@ def test_positive_applied_errata_by_install_date(
.search(query={'search': 'name="Host - Applied Errata"'})[0]
.read()
)
# Generate a report for Today and Yesterday
today_local = (datetime.now() - timedelta(minutes=5)).strftime('%Y-%m-%d %H:%M:%S')
yesterday_local = (datetime.now() - timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S')
# Generate a report for Today and Yesterday (UTC)
today_utc = (datetime.utcnow() - timedelta(minutes=15)).strftime('%Y-%m-%d %H:%M:%S')
yesterday_utc = (datetime.utcnow() - timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S')
report_today = rt.generate(
data={
'organization_id': module_org.id,
'report_format': 'json',
'input_values': {
'Since': today_local,
'Since': today_utc,
'Filter Errata Type': 'all',
'Include Last Reboot': 'no',
'Status': 'all',
Expand All @@ -1213,7 +1213,7 @@ def test_positive_applied_errata_by_install_date(
'organization_id': module_org.id,
'report_format': 'json',
'input_values': {
'Up to': yesterday_local,
'Up to': yesterday_utc,
'Filter Errata Type': 'all',
'Include Last Reboot': 'no',
'Status': 'all',
Expand Down

0 comments on commit 88f46ea

Please sign in to comment.