Bug 19198: Prevent the test to fail randomly
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 6 Oct 2017 14:58:42 +0000 (11:58 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 6 Oct 2017 15:00:19 +0000 (12:00 -0300)
If categorycode is 'X', the test will fail

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

t/db_dependent/Circulation.t

index 8d9d856..17752bd 100755 (executable)
@@ -1821,7 +1821,7 @@ subtest 'Set waiting flag' => sub {
     is( $status, 'Waiting', 'Now the hold is waiting');
 };
 
-subtest 'AddReturn | is_overdue' => sub {
+subtest 'CanBookBeIssued | is_overdue' => sub {
     plan tests => 3;
 
     # Set a simple circ policy
@@ -1850,7 +1850,7 @@ subtest 'AddReturn | is_overdue' => sub {
     my $five_days_go = output_pref({ dt => dt_from_string->add( days => 5 ), dateonly => 1});
     my $ten_days_go  = output_pref({ dt => dt_from_string->add( days => 10), dateonly => 1 });
     my $library = $builder->build( { source => 'Branch' } );
-    my $patron  = $builder->build( { source => 'Borrower' } );
+    my $patron  = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } );
 
     my $biblioitem = $builder->build( { source => 'Biblioitem' } );
     my $item = $builder->build(