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 <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Fridolin Somers 2022-01-28 14:50:26 -10:00
parent bb316c5ded
commit caa1712d9f
2 changed files with 10 additions and 10 deletions

View File

@ -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,

View File

@ -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,