Bug 29145: (QA follow-up) Fix tests removing 'unblessed'

This fixes issues with the tests caused by:
Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2023-09-29 13:49:47 +00:00 committed by Tomas Cohen Arazi
parent 51ec5d8a62
commit 855a18f8ab
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -234,9 +234,9 @@ subtest 'AutoRemoveOverduesRestrictions' => sub {
my $ten_days_ago = dt_from_string->subtract( days => 10 );
$checkout_1 = AddIssue( $patron->unblessed, $item_1->barcode, $ten_days_ago ); # overdue and would trigger debarment
$checkout_1 = AddIssue( $patron, $item_1->barcode, $ten_days_ago ); # overdue and would trigger debarment
$checkout_2 =
AddIssue( $patron->unblessed, $item_2->barcode, $nine_days_ago ); # overdue, but would not trigger debarment
AddIssue( $patron, $item_2->barcode, $nine_days_ago ); # overdue, but would not trigger debarment
Koha::Patron::Debarments::AddUniqueDebarment(
{
@ -254,7 +254,7 @@ subtest 'AutoRemoveOverduesRestrictions' => sub {
'OVERDUES debarment is removed if remaining items would not result in patron debarment'
);
$checkout_1 = AddIssue( $patron->unblessed, $item_1->barcode, $ten_days_ago ); # overdue and would trigger debarment
$checkout_1 = AddIssue( $patron, $item_1->barcode, $ten_days_ago ); # overdue and would trigger debarment
Koha::Patron::Debarments::AddUniqueDebarment(
{
@ -275,7 +275,7 @@ subtest 'AutoRemoveOverduesRestrictions' => sub {
my $eleven_days_ago = dt_from_string->subtract( days => 11 );
# overdue and would trigger debarment
$checkout_2 = AddIssue( $patron->unblessed, $item_2->barcode, $eleven_days_ago );
$checkout_2 = AddIssue( $patron, $item_2->barcode, $eleven_days_ago );
# $checkout_1 should now not trigger debarment with this new rule for specific branchcode
$dbh->do(