From 757be1321109fba491157dc20744effcb0bd3e8d Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 24 Nov 2023 07:22:48 +0000 Subject: [PATCH] Bug 35393: Fix Objects.t - filter_by_last_update Test plan: Keep awake until just after midnight :) Run t/db_dependent/Koha/Objects.t Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Koha/Objects.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t index 9891b37896..a868b5c3d0 100755 --- a/t/db_dependent/Koha/Objects.t +++ b/t/db_dependent/Koha/Objects.t @@ -1191,7 +1191,7 @@ subtest "filter_by_last_update" => sub { subtest 'Parameters older_than, younger_than' => sub { my $now = dt_from_string(); my $rs = Koha::Patrons->search( { borrowernumber => { -in => \@borrowernumbers } } ); - $rs->update( { updated_on => $now->clone->subtract( hours => 25 ) } ); + $rs->update( { updated_on => $now->clone->subtract( hours => 24 ) } ); is( $rs->filter_by_last_update( { timestamp_column_name => 'updated_on', from => $now } )->count, 0, 'All updated yesterday' @@ -1208,17 +1208,17 @@ subtest "filter_by_last_update" => sub { ); is( $rs->filter_by_last_update( - { timestamp_column_name => 'updated_on', from => $now->clone->subtract( days => 1 ), } + { timestamp_column_name => 'updated_on', from => $now->clone->subtract( minutes => 24 * 60 - 1 ), } )->count, 0, - 'Yesterday, not truncated, one hour too late' + 'Yesterday + 1m, not truncated, no results' ); is( $rs->filter_by_last_update( - { timestamp_column_name => 'updated_on', from => $now->clone->subtract( hours => 25 ), } + { timestamp_column_name => 'updated_on', from => $now->clone->subtract( hours => 24 ), } )->count, 6, - 'Yesterday - 1h, not truncated, within time frame' + 'Yesterday, not truncated, results' ); }; -- 2.39.5