From 572cfe1aa2ca349c7ef11c11504de528cde31c15 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 10 Feb 2025 12:58:46 +0100 Subject: [PATCH] Bug 38474: Prevent Letters.t to fail on slow server We must always use t::lib::Dates::compare when we compare dates in tests. --- t/db_dependent/Letters.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index a1526f8e222..70f51d9ffa6 100755 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -29,6 +29,8 @@ use Email::Sender::Failure; use MARC::Record; +use t::lib::Dates; + use utf8; my ( $email_object, $sendmail_params ); @@ -153,7 +155,10 @@ is( $messages->[0]->{content}, $my_message->{letter}->{content}, 'EnqueueLetter is( $messages->[0]->{message_transport_type}, $my_message->{message_transport_type}, 'EnqueueLetter stores the message type correctly' ); is( $messages->[0]->{status}, 'pending', 'EnqueueLetter stores the status pending correctly' ); isnt( $messages->[0]->{time_queued}, undef, 'Time queued inserted by default in message_queue table' ); -is( $messages->[0]->{updated_on}, $messages->[0]->{time_queued}, 'Time status changed equals time queued when created in message_queue table' ); +is( + t::lib::Dates::compare( $messages->[0]->{updated_on}, $messages->[0]->{time_queued} ), 0, + 'Time status changed equals time queued when created in message_queue table' +); is( $messages->[0]->{failure_code}, '', 'Failure code for successful message correctly empty'); # Setting time_queued to something else than now -- 2.34.1