Bugzilla – Attachment 95123 Details for
Bug 23293
OPACFineNoRenewals always compares against 'balance' not 'outstanding'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23293: (follow-up) Add tests for C4::Circulation change
Bug-23293-follow-up-Add-tests-for-C4Circulation-ch.patch (text/plain), 3.08 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-11-06 18:48:54 UTC
(
hide
)
Description:
Bug 23293: (follow-up) Add tests for C4::Circulation change
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-11-06 18:48:54 UTC
Size:
3.08 KB
patch
obsolete
>From 7326296afdac6d14c4b82d840ac84585b1faf45f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 25 Sep 2019 10:59:03 +0100 >Subject: [PATCH] Bug 23293: (follow-up) Add tests for C4::Circulation change > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Circulation.t | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 764665fba8..9dfbd532a7 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -721,8 +721,8 @@ subtest "CanBookBeRenewed tests" => sub { > is( $error, 'auto_renew', 'Cannot renew, renew is automatic' ); > }; > >- subtest "auto_too_much_oweing | OPACFineNoRenewalsBlockAutoRenew" => sub { >- plan tests => 6; >+ subtest "auto_too_much_oweing | OPACFineNoRenewalsBlockAutoRenew & OPACFineNoRenewalsIncludeCredit" => sub { >+ plan tests => 10; > my $item_to_auto_renew = $builder->build({ > source => 'Item', > value => { >@@ -739,6 +739,7 @@ subtest "CanBookBeRenewed tests" => sub { > $dbh->do('UPDATE issuingrules SET norenewalbefore = 10, no_auto_renewal_after = 11'); > C4::Context->set_preference('OPACFineNoRenewalsBlockAutoRenew','1'); > C4::Context->set_preference('OPACFineNoRenewals','10'); >+ C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1'); > my $fines_amount = 5; > my $account = Koha::Account->new({patron_id => $renewing_borrowernumber}); > $account->add_debit( >@@ -783,7 +784,27 @@ subtest "CanBookBeRenewed tests" => sub { > is( $renewokay, 0, 'Do not renew, renewal is automatic' ); > is( $error, 'auto_too_much_oweing', 'Cannot auto renew, OPACFineNoRenewals=10, patron has 15' ); > >+ $account->add_credit( >+ { >+ amount => $fines_amount, >+ interface => 'test', >+ type => 'overdue', >+ description => "Some fines" >+ } >+ )->store; >+ ( $renewokay, $error ) = >+ CanBookBeRenewed( $renewing_borrowernumber, $item_to_auto_renew->{itemnumber} ); >+ is( $renewokay, 0, 'Do not renew, renewal is automatic' ); >+ is( $error, 'auto_renew', 'Can auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit' ); >+ >+ C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','0'); >+ ( $renewokay, $error ) = >+ CanBookBeRenewed( $renewing_borrowernumber, $item_to_auto_renew->{itemnumber} ); >+ is( $renewokay, 0, 'Do not renew, renewal is automatic' ); >+ is( $error, 'auto_too_much_oweing', 'Cannot auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit' ); >+ > $dbh->do('DELETE FROM accountlines WHERE borrowernumber=?', undef, $renewing_borrowernumber); >+ C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1'); > }; > > subtest "auto_account_expired | BlockExpiredPatronOpacActions" => sub { >-- >2.24.0
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 23293
:
91448
|
91449
|
93149
|
93150
|
93151
|
95121
|
95122
|
95123
|
95124
|
95143
|
95144
|
95145
|
95146