|
Lines 1275-1281
subtest 'store check barcodes' => sub {
Link Here
|
| 1275 |
}; |
1275 |
}; |
| 1276 |
|
1276 |
|
| 1277 |
subtest 'deletion' => sub { |
1277 |
subtest 'deletion' => sub { |
| 1278 |
plan tests => 16; |
1278 |
plan tests => 18; |
| 1279 |
|
1279 |
|
| 1280 |
$schema->storage->txn_begin; |
1280 |
$schema->storage->txn_begin; |
| 1281 |
|
1281 |
|
|
Lines 1356-1361
subtest 'deletion' => sub {
Link Here
|
| 1356 |
'IndependentBranches prevents deletion at another branch', |
1356 |
'IndependentBranches prevents deletion at another branch', |
| 1357 |
); |
1357 |
); |
| 1358 |
|
1358 |
|
|
|
1359 |
# item_has_holds |
| 1360 |
my $item_level_hold = $builder->build_object( |
| 1361 |
{ |
| 1362 |
class => 'Koha::Holds', |
| 1363 |
value => { |
| 1364 |
biblionumber => $item->biblionumber, |
| 1365 |
itemnumber => $item->itemnumber, |
| 1366 |
found => undef, |
| 1367 |
} |
| 1368 |
} |
| 1369 |
); |
| 1370 |
|
| 1371 |
$item->discard_changes; |
| 1372 |
my $safe_to_delete = $item->safe_to_delete; |
| 1373 |
ok( !$safe_to_delete, 'Cannot delete item with item level holds' ); |
| 1374 |
is( |
| 1375 |
@{ $safe_to_delete->messages }[0]->message, |
| 1376 |
'item_has_holds', |
| 1377 |
'Koha::Item->safe_to_delete reports item has item level holds', |
| 1378 |
); |
| 1379 |
|
| 1380 |
$item_level_hold->delete; |
| 1381 |
|
| 1359 |
# linked_analytics |
1382 |
# linked_analytics |
| 1360 |
|
1383 |
|
| 1361 |
{ # codeblock to limit scope of $module->mock |
1384 |
{ # codeblock to limit scope of $module->mock |