From caa1712d9ffee34975fe92de26c1ede92f8a6425 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Fri, 28 Jan 2022 14:50:26 -1000 Subject: [PATCH] Bug 29976: (Bug 21729 follow-up) fix holds unit tests Bug 21729 added to holds table the column patron_expiration_date. Currently test suite is failing : https://jenkins.koha-community.org/view/master/job/Koha_Master_D10/516/testReport/ We must fix where TestBuilder is creating with source Reserve and data expirationdate : t/db_dependent/Holds/WaitingReserves.t t/db_dependent/Reserves/CancelExpiredReserves.t Note that t/db_dependent/Reserves/CancelExpiredReserves.t does not fail without this patch but surely we prefere change it also. Test plan : prove t/db_dependent/Holds/WaitingReserves.t prove t/db_dependent/Reserves/CancelExpiredReserves.t Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers --- t/db_dependent/Holds/WaitingReserves.t | 8 ++++---- t/db_dependent/Reserves/CancelExpiredReserves.t | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/t/db_dependent/Holds/WaitingReserves.t b/t/db_dependent/Holds/WaitingReserves.t index feeaf40716..111bcfa70f 100755 --- a/t/db_dependent/Holds/WaitingReserves.t +++ b/t/db_dependent/Holds/WaitingReserves.t @@ -82,7 +82,7 @@ my $reserve1 = $builder->build({ value => { borrowernumber => $patron1->{borrowernumber}, reservedate => $reserve1_reservedate->ymd, - expirationdate => undef, + patron_expiration_date => undef, biblionumber => $biblio->biblionumber, branchcode => 'LIB1', priority => 1, @@ -107,7 +107,7 @@ my $reserve2 = $builder->build({ value => { borrowernumber => $patron2->{borrowernumber}, reservedate => $reserve1_reservedate->ymd, - expirationdate => undef, + patron_expiration_date => undef, biblionumber => $biblio2->biblionumber, branchcode => 'LIB1', priority => 1, @@ -127,7 +127,7 @@ my $reserve3 = $builder->build({ value => { borrowernumber => $patron2->{borrowernumber}, reservedate => $reserve1_reservedate->ymd, - expirationdate => undef, + patron_expiration_date => undef, biblionumber => $biblio3->biblionumber, branchcode => 'LIB1', priority => 1, @@ -185,7 +185,7 @@ my $reserve4 = $builder->build({ value => { borrowernumber => $patron2->{borrowernumber}, reservedate => $reserve4_reservedate->ymd, - expirationdate => $requested_expiredate->ymd, + patron_expiration_date => $requested_expiredate->ymd, biblionumber => $biblio4->biblionumber, branchcode => 'LIB1', priority => 1, diff --git a/t/db_dependent/Reserves/CancelExpiredReserves.t b/t/db_dependent/Reserves/CancelExpiredReserves.t index 3b1480c0b3..4b6886989a 100755 --- a/t/db_dependent/Reserves/CancelExpiredReserves.t +++ b/t/db_dependent/Reserves/CancelExpiredReserves.t @@ -37,7 +37,7 @@ subtest 'CancelExpiredReserves tests incl. holidays' => sub { source => 'Reserve', value => { reservedate => $reserve_reservedate, - expirationdate => $reserve1_expirationdate, + patron_expiration_date => $reserve1_expirationdate, cancellationdate => undef, priority => 0, found => 'W', @@ -56,7 +56,7 @@ subtest 'CancelExpiredReserves tests incl. holidays' => sub { source => 'Reserve', value => { reservedate => $reserve_reservedate, - expirationdate => $reserve2_expirationdate, + patron_expiration_date => $reserve2_expirationdate, cancellationdate => undef, priority => 0, found => 'W', @@ -72,7 +72,7 @@ subtest 'CancelExpiredReserves tests incl. holidays' => sub { source => 'Reserve', value => { reservedate => $reserve_reservedate, - expirationdate => $reserve2_expirationdate, + patron_expiration_date => $reserve2_expirationdate, branchcode => 'LIB1', cancellationdate => undef, priority => 0, @@ -172,7 +172,7 @@ subtest 'Test handling of in transit reserves by CancelExpiredReserves' => sub { my $reserve = $builder->build({ source => 'Reserve', value => { - expirationdate => '2018-01-01', + patron_expiration_date => '2018-01-01', found => 'T', cancellationdate => undef, suspend => 0, @@ -187,7 +187,7 @@ subtest 'Test handling of in transit reserves by CancelExpiredReserves' => sub { my $reserve2 = $builder->build({ source => 'Reserve', value => { - expirationdate => '2018-01-01', + patron_expiration_date => '2018-01-01', found => 'T', cancellationdate => undef, suspend => 0, @@ -208,7 +208,7 @@ subtest 'Test handling of cancellation reason if passed' => sub { my $reserve = $builder->build({ source => 'Reserve', value => { - expirationdate => '2018-01-01', + patron_expiration_date => '2018-01-01', found => 'T', cancellationdate => undef, suspend => 0, -- 2.39.5