From 298e891a8590db5243dcc65d19441cf162351653 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Thu, 5 Mar 2020 16:27:15 +0100
Subject: [PATCH] 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!
---
 t/db_dependent/api/v1/holds.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t
index df10cbca61..8c3aa2fb4e 100644
--- a/t/db_dependent/api/v1/holds.t
+++ b/t/db_dependent/api/v1/holds.t
@@ -392,7 +392,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 }
         }
     );
 
-- 
2.20.1