Bugzilla – Attachment 92626 Details for
Bug 23404
Circulation::TooMany error on itemtype when at biblio level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23404: add UT to show bug
Bug-23404-add-UT-to-show-bug.patch (text/plain), 3.11 KB, created by
Kyle M Hall (khall)
on 2019-09-06 10:32:48 UTC
(
hide
)
Description:
Bug 23404: add UT to show bug
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-09-06 10:32:48 UTC
Size:
3.11 KB
patch
obsolete
>From 184748ebf3f58a3bbf6efda16cce5db3ae67441c Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 31 Jul 2019 11:21:14 +0200 >Subject: [PATCH] Bug 23404: add UT to show bug > >Run prove t/db_dependent/Circulation/TooMany.t >It fails on : > # Failed test 'We are only allowed one, and we have one (itemtype on biblioitem)' > # at t/db_dependent/Circulation/TooMany.t line 547. > # Structures begin differing at: > # $got->{reason} = 'NO_RULE_DEFINED' > # $expected->{reason} = 'TOO_MANY_CHECKOUTS' > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Circulation/TooMany.t | 23 +++++++++++++++++++---- > 1 file changed, 19 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Circulation/TooMany.t b/t/db_dependent/Circulation/TooMany.t >index 0f39f11888..863eeef5ad 100644 >--- a/t/db_dependent/Circulation/TooMany.t >+++ b/t/db_dependent/Circulation/TooMany.t >@@ -466,7 +466,7 @@ subtest '1 BranchBorrowerCircRule exist: 1 CO allowed, 1 OSCO allowed' => sub { > }; > > subtest 'General vs specific rules limit quantity correctly' => sub { >- plan tests => 9; >+ plan tests => 10; > > t::lib::Mocks::mock_preference('CircControl', 'ItemHomeLibrary'); > my $branch = $builder->build({source => 'Branch',}); >@@ -516,7 +516,7 @@ subtest 'General vs specific rules limit quantity correctly' => sub { > ); > > # Create an item >- my $item = $builder->build_sample_item({ >+ my $issue_item = $builder->build_sample_item({ > itype => $itemtype->{itemtype} > }); > my $branch_item = $builder->build_sample_item({ >@@ -527,7 +527,7 @@ subtest 'General vs specific rules limit quantity correctly' => sub { > > > t::lib::Mocks::mock_userenv({ branchcode => $branch->{branchcode} }); >- my $issue = C4::Circulation::AddIssue( $patron, $item->barcode, dt_from_string() ); >+ my $issue = C4::Circulation::AddIssue( $patron, $issue_item->barcode, dt_from_string() ); > # We checkout one item > is_deeply( > C4::Circulation::TooMany( $patron, $branch_item->biblionumber, $branch_item->unblessed ), >@@ -536,9 +536,24 @@ subtest 'General vs specific rules limit quantity correctly' => sub { > count => 1, > max_allowed => 1, > }, >- 'We are only allowed one, and we have one' >+ 'We are only allowed one, and we have one (itemtype on item)' > ); > >+ # Check itemtype on biblio level >+ t::lib::Mocks::mock_preference('item-level_itypes', 0); >+ $issue_item->biblio->biblioitem->itemtype($itemtype->{itemtype})->store; >+ $branch_item->biblio->biblioitem->itemtype($itemtype->{itemtype})->store; >+ # We checkout one item >+ is_deeply( >+ C4::Circulation::TooMany( $patron, $branch_item->biblionumber, $branch_item->unblessed ), >+ { >+ reason => 'TOO_MANY_CHECKOUTS', >+ count => 1, >+ max_allowed => 1, >+ }, >+ 'We are only allowed one, and we have one (itemtype on biblioitem)' >+ ); >+ t::lib::Mocks::mock_preference('item-level_itypes', 1); > > # Set a branch specific rule > Koha::CirculationRules->set_rules( >-- >2.20.1 (Apple Git-117)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23404
:
91891
|
91892
|
91893
|
92626
|
92627
|
92628
|
92655
|
92656
|
92657
|
92658