Bug 19423: Prevent DecreaseLoanHighHolds.t to fail randomly
CanBookBeIssued returns STATS if categorycode is X Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
0d124e1bc3
commit
090b450a50
1 changed files with 3 additions and 2 deletions
|
@ -51,10 +51,11 @@ C4::Context->_new_userenv('xxx');
|
||||||
C4::Context->set_userenv( 0, 0, 0, 'firstname', 'surname', $library->{branchcode}, 'Midway Public Library', '', '', '' );
|
C4::Context->set_userenv( 0, 0, 0, 'firstname', 'surname', $library->{branchcode}, 'Midway Public Library', '', '', '' );
|
||||||
is( C4::Context->userenv->{branch}, $library->{branchcode}, 'userenv set' );
|
is( C4::Context->userenv->{branch}, $library->{branchcode}, 'userenv set' );
|
||||||
|
|
||||||
|
my $patron_category = $builder->build({ source => 'Category', value => { categorycode => 'NOT_X', category_type => 'P', enrolmentfee => 0 } });
|
||||||
my @patrons;
|
my @patrons;
|
||||||
for my $i ( 1 .. 20 ) {
|
for my $i ( 1 .. 20 ) {
|
||||||
my $patron = Koha::Patron->new(
|
my $patron = Koha::Patron->new(
|
||||||
{ cardnumber => $i, firstname => 'Kyle', surname => 'Hall', categorycode => $category->{categorycode}, branchcode => $library->{branchcode} } )
|
{ cardnumber => $i, firstname => 'Kyle', surname => 'Hall', categorycode => $category->{categorycode}, branchcode => $library->{branchcode}, categorycode => $patron_category->{categorycode}, } )
|
||||||
->store();
|
->store();
|
||||||
push( @patrons, $patron );
|
push( @patrons, $patron );
|
||||||
}
|
}
|
||||||
|
@ -183,7 +184,7 @@ is( $data->{exceeded}, 1, "Should exceed threshold with one withdrawn item" );
|
||||||
|
|
||||||
t::lib::Mocks::mock_preference('CircControl', 'PatronLibrary');
|
t::lib::Mocks::mock_preference('CircControl', 'PatronLibrary');
|
||||||
|
|
||||||
my ( undef, $needsconfirmation ) = CanBookBeIssued( $patron_hr, $item->barcode );
|
my ( $un, $needsconfirmation ) = CanBookBeIssued( $patron_hr, $item->barcode );
|
||||||
ok( $needsconfirmation->{HIGHHOLDS}, "High holds checkout needs confirmation" );
|
ok( $needsconfirmation->{HIGHHOLDS}, "High holds checkout needs confirmation" );
|
||||||
|
|
||||||
( undef, $needsconfirmation ) = CanBookBeIssued( $patron_hr, $item->barcode, undef, undef, undef, { override_high_holds => 1 } );
|
( undef, $needsconfirmation ) = CanBookBeIssued( $patron_hr, $item->barcode, undef, undef, undef, { override_high_holds => 1 } );
|
||||||
|
|
Loading…
Reference in a new issue