Bug 20721: (bug 19403 follow-up) Prevent Circulation.t to fail randomly

If items.restricted == 1, CanBookBeIssued will not returned what we are
testing.

The easiest and global fix is to define a default value at TestBuilder
package level

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-05-07 13:15:34 -03:00
parent 9a1bed84d6
commit 8bb531b530
2 changed files with 4 additions and 22 deletions

View file

@ -1216,10 +1216,6 @@ subtest 'CanBookBeIssued & AllowReturnToBranch' => sub {
value => { value => {
homebranch => $homebranch->{branchcode}, homebranch => $homebranch->{branchcode},
holdingbranch => $holdingbranch->{branchcode}, holdingbranch => $holdingbranch->{branchcode},
notforloan => 0,
itemlost => 0,
withdrawn => 0,
restricted => 0,
biblionumber => $biblioitem->{biblionumber} biblionumber => $biblioitem->{biblionumber}
} }
} }
@ -1381,10 +1377,6 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
value => { value => {
homebranch => $library->{branchcode}, homebranch => $library->{branchcode},
holdingbranch => $library->{branchcode}, holdingbranch => $library->{branchcode},
notforloan => 0,
itemlost => 0,
withdrawn => 0,
restricted => 0,
biblionumber => $biblioitem_1->{biblionumber} biblionumber => $biblioitem_1->{biblionumber}
} }
} }
@ -1395,10 +1387,6 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
value => { value => {
homebranch => $library->{branchcode}, homebranch => $library->{branchcode},
holdingbranch => $library->{branchcode}, holdingbranch => $library->{branchcode},
notforloan => 0,
itemlost => 0,
withdrawn => 0,
restricted => 0,
biblionumber => $biblioitem_2->{biblionumber} biblionumber => $biblioitem_2->{biblionumber}
} }
} }
@ -1462,10 +1450,6 @@ subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
value => { value => {
homebranch => $library->branchcode, homebranch => $library->branchcode,
holdingbranch => $library->branchcode, holdingbranch => $library->branchcode,
notforloan => 0,
itemlost => 0,
withdrawn => 0,
restricted => 0,
biblionumber => $biblioitem_1->{biblionumber} biblionumber => $biblioitem_1->{biblionumber}
} }
} }
@ -1592,9 +1576,6 @@ subtest 'CanBookBeIssued + AllowMultipleIssuesOnABiblio' => sub {
value => { value => {
homebranch => $library->{branchcode}, homebranch => $library->{branchcode},
holdingbranch => $library->{branchcode}, holdingbranch => $library->{branchcode},
notforloan => 0,
itemlost => 0,
withdrawn => 0,
biblionumber => $biblionumber, biblionumber => $biblionumber,
} }
} }
@ -1604,9 +1585,6 @@ subtest 'CanBookBeIssued + AllowMultipleIssuesOnABiblio' => sub {
value => { value => {
homebranch => $library->{branchcode}, homebranch => $library->{branchcode},
holdingbranch => $library->{branchcode}, holdingbranch => $library->{branchcode},
notforloan => 0,
itemlost => 0,
withdrawn => 0,
biblionumber => $biblionumber, biblionumber => $biblionumber,
} }
} }

View file

@ -471,6 +471,10 @@ sub _gen_default_values {
borrowernotes => '', borrowernotes => '',
}, },
Item => { Item => {
notforloan => 0,
itemlost => 0,
withdrawn => 0,
restricted => 0,
more_subfields_xml => undef, more_subfields_xml => undef,
}, },
Category => { Category => {