From 977e6f312e9f838be10c3ad790e1f58bb5f733fc Mon Sep 17 00:00:00 2001 From: David Moore <109112035+damoore044@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:01:43 -0500 Subject: [PATCH] Fix Date assertion failure in CI errata:e2e (#13121) * Date fix for CI * Parse datetime, account for most formats --- tests/foreman/ui/test_errata.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/foreman/ui/test_errata.py b/tests/foreman/ui/test_errata.py index b181396c047..b90705a6ab0 100644 --- a/tests/foreman/ui/test_errata.py +++ b/tests/foreman/ui/test_errata.py @@ -20,6 +20,7 @@ from airgun.session import Session from broker import Broker +from dateutil.parser import parse from fauxfactory import gen_string from manifester import Manifester from nailgun import entities @@ -286,8 +287,6 @@ def test_end_to_end( 'cves': 'N/A', 'type': 'Security Advisory', 'severity': 'N/A', - 'issued': 'January 27, 2012 at 12:00 AM', - 'last_updated_on': 'January 27, 2012 at 12:00 AM', 'reboot_suggested': 'No', 'topic': '', 'description': 'Sea_Erratum', @@ -334,8 +333,8 @@ def test_end_to_end( assert ( not ERRATA_DETAILS.items() - errata['details'].items() ), 'Errata details do not match expected values.' - assert errata['details']['issued'] == ERRATA_DETAILS['issued'] - assert errata['details']['last_updated_on'] == ERRATA_DETAILS['last_updated_on'] + assert parse(errata['details']['issued']) == parse('2012-01-27 12:00:00 AM') + assert parse(errata['details']['last_updated_on']) == parse('2012-01-27 12:00:00 AM') assert set(errata['packages']['independent_packages']) == set( ERRATA_PACKAGES['independent_packages'] )