Bug 34918: Fix userenv for safe_to_delete tests

Instead of the fallback to 51, we pass a borrower that has
permission for editing items.

Test plan:
Do not apply patch.
Run test without a borrower 51 in db. (FAIL)
Apply patch.
Run test again. (PASS)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2023-09-27 10:43:04 +00:00 committed by Tomas Cohen Arazi
parent 3298b27985
commit f8233f44a5
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 3 additions and 2 deletions

View File

@ -869,9 +869,10 @@ subtest 'deletion' => sub {
my $library = $builder->build_object({ class => 'Koha::Libraries' });
my $library_2 = $builder->build_object({ class => 'Koha::Libraries' });
t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
my $patron = $builder->build_object({class => 'Koha::Patrons'});
my $patron = $builder->build_object({class => 'Koha::Patrons', value => { flags => 2^9 } }); # allow edit items
t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode, borrowernumber => $patron->id });
$item = $builder->build_sample_item({ library => $library->branchcode });
# book_on_loan