Bug 28972: Fix failing tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-09-20 16:11:35 +02:00
parent d587341d34
commit 166ebea01f
2 changed files with 11 additions and 11 deletions

View file

@ -978,7 +978,7 @@ subtest "Test Local Holds Priority - Bib level" => sub {
is( $queue_rs->count(), 1,
"Hold queue contains one hold" );
is(
$queue_rs->next->borrowernumber,
$queue_rs->next->borrowernumber->borrowernumber,
$local_patron->borrowernumber,
"We should pick the local hold over the next available"
);
@ -1048,7 +1048,7 @@ subtest "Test Local Holds Priority - Item level" => sub {
is( $queue_rs->count(), 1,
"Hold queue contains one hold" );
is(
$q->borrowernumber,
$q->borrowernumber->borrowernumber,
$local_patron->borrowernumber,
"We should pick the local hold over the next available"
);
@ -1116,7 +1116,7 @@ subtest "Test Local Holds Priority - Item level hold over Record level hold (Bug
is( $queue_rs->count(), 1,
"Hold queue contains one hold" );
is(
$q->borrowernumber,
$q->borrowernumber->borrowernumber,
$local_patron->borrowernumber,
"We should pick the local hold over the next available"
);
@ -1193,7 +1193,7 @@ subtest "Test Local Holds Priority - Get correct item for item level hold" => su
is( $queue_rs->count(), 1,
"Hold queue contains one hold" );
is(
$q->borrowernumber,
$q->borrowernumber->borrowernumber,
$local_patron->borrowernumber,
"We should pick the local hold over the next available"
);
@ -1444,7 +1444,7 @@ subtest 'Excludes from local holds priority' => sub {
my $queue_rs = $schema->resultset('TmpHoldsqueue');
my $next = $queue_rs->next;
is($queue_rs->count, 1, 'Only 1 patron queueud' );
is($next->borrowernumber, $local_patron_not_excluded->borrowernumber, 'Not excluded local patron is queued');
is($next->borrowernumber->borrowernumber, $local_patron_not_excluded->borrowernumber, 'Not excluded local patron is queued');
my $item2 = $builder->build_sample_item(
{
@ -1458,9 +1458,9 @@ subtest 'Excludes from local holds priority' => sub {
$queue_rs = $schema->resultset('TmpHoldsqueue');
is( $queue_rs->count, 2, '2 patrons queued' );
$next = $queue_rs->next;
is($next->borrowernumber, $local_patron_not_excluded->borrowernumber, 'Not excluded local patron is queued');
is($next->borrowernumber->borrowernumber, $local_patron_not_excluded->borrowernumber, 'Not excluded local patron is queued');
$next = $queue_rs->next;
is($next->borrowernumber, $other_patron->borrowernumber, 'Other patron is queued');
is($next->borrowernumber->borrowernumber, $other_patron->borrowernumber, 'Other patron is queued');
$item1->exclude_from_local_holds_priority(1)->store;
@ -1469,9 +1469,9 @@ subtest 'Excludes from local holds priority' => sub {
$queue_rs = $schema->resultset('TmpHoldsqueue');
is( $queue_rs->count, 2, '2 patrons queued' );
$next = $queue_rs->next;
is($next->borrowernumber, $other_patron->borrowernumber, 'Other patron is queued');
is($next->borrowernumber->borrowernumber, $other_patron->borrowernumber, 'Other patron is queued');
$next = $queue_rs->next;
is($next->borrowernumber, $local_patron_excluded->borrowernumber, 'Excluded local patron is queued');
is($next->borrowernumber->borrowernumber, $local_patron_excluded->borrowernumber, 'Excluded local patron is queued');
};
# Cleanup
$schema->storage->txn_rollback;

View file

@ -1034,8 +1034,8 @@ subtest 'move_to_biblio() tests' => sub {
my $get_tmp_holdsqueue1 = $schema->resultset('TmpHoldsqueue')->search({ itemnumber => $tmp_holdsqueue1->{itemnumber} })->single;
my $get_tmp_holdsqueue2 = $schema->resultset('TmpHoldsqueue')->search({ itemnumber => $tmp_holdsqueue2->{itemnumber} })->single;
is($get_tmp_holdsqueue1->biblionumber, $target_biblionumber, 'move_to_biblio moves tmp_holdsqueue for item 1');
is($get_tmp_holdsqueue2->biblionumber, $source_biblionumber, 'move_to_biblio does not move tmp_holdsqueue for item 2');
is($get_tmp_holdsqueue1->biblionumber->biblionumber, $target_biblionumber, 'move_to_biblio moves tmp_holdsqueue for item 1');
is($get_tmp_holdsqueue2->biblionumber->biblionumber, $source_biblionumber, 'move_to_biblio does not move tmp_holdsqueue for item 2');
my $get_hold_fill_target1 = $schema->resultset('HoldFillTarget')->search({ itemnumber => $hold_fill_target1->{itemnumber} })->single;
my $get_hold_fill_target2 = $schema->resultset('HoldFillTarget')->search({ itemnumber => $hold_fill_target2->{itemnumber} })->single;