From 88f46ea163256b649eaaf06be7a7aa26378c34a1 Mon Sep 17 00:00:00 2001 From: David Moore Date: Thu, 27 Feb 2025 13:33:58 -0500 Subject: [PATCH] UTC timezone used for CI testing --- tests/foreman/api/test_reporttemplates.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/foreman/api/test_reporttemplates.py b/tests/foreman/api/test_reporttemplates.py index 97e5ff5dc7..b7cf8b07f2 100644 --- a/tests/foreman/api/test_reporttemplates.py +++ b/tests/foreman/api/test_reporttemplates.py @@ -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 @@ -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', @@ -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',