Bug 24813: Prevent api/v1/holds.t to fail randomly

Hold cannot be suspended if found=W:
Koha::Hold->suspend_hold
 90     if ( $self->is_found ) {    # We can't suspend found holds

So when TestBuilder generate a hold with found=W the test fail.

A question however:
Why did not we have the correct exception displayed somewhere? That
would be much more helpful to find the problem!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c405b03dd3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1993e98edf)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
This commit is contained in:
Jonathan Druart 2020-03-05 16:27:15 +01:00 committed by Hayley Mapley
parent ef79c94ebd
commit db9102617e
1 changed files with 1 additions and 1 deletions

View File

@ -347,7 +347,7 @@ subtest 'suspend and resume tests' => sub {
my $hold = $builder->build_object(
{ class => 'Koha::Holds',
value => { suspend => 0, suspend_until => undef, waitingdate => undef }
value => { suspend => 0, suspend_until => undef, waitingdate => undef, found => undef }
}
);