Bugzilla – Attachment 65375 Details for
Bug 18802
Circulation.t fails if finesMode != "Do not calculate"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18802: Fix Circulation.t if finesMode ne 'production'
Bug-18802-Fix-Circulationt-if-finesMode-ne-product.patch (text/plain), 3.02 KB, created by
Jonathan Druart
on 2017-07-31 19:34:56 UTC
(
hide
)
Description:
Bug 18802: Fix Circulation.t if finesMode ne 'production'
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-07-31 19:34:56 UTC
Size:
3.02 KB
patch
obsolete
>From a628a9d5c644067879fee51555ae7d06fd40d8db Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 14 Jun 2017 11:32:30 -0300 >Subject: [PATCH] Bug 18802: Fix Circulation.t if finesMode ne 'production' > >If finesMode is not set to production, only 1 fine will be created (the renewal >one will not). This is what assumes the tests. >If set to 'production', the tests will fail because the fines will not >be deleted (because of the DBIx::Class) warning. >Now we mock the value before charging. > >prove t/db_dependent/Circulation.t >t/db_dependent/Circulation.t .. 16/95 DBIx::Class::Storage::DBI::select_single(): Query returned more than one row. SQL that returns multiple rows is DEPRECATED for ->find and ->single at t/db_dependent/Circulation.t line 491 >t/db_dependent/Circulation.t .. 56/95 > # Failed test 'Can auto renew, OPACFineNoRenewals=10, patron has 10' > # at t/db_dependent/Circulation.t line 670. > # got: 'auto_too_much_oweing' > # expected: 'auto_renew' > # Looks like you failed 1 test of 6. > >Test plan: > prove t/db_dependent/Circulation.t >should return green whatever the value of finesMode >--- > t/db_dependent/Circulation.t | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 9319924..6252567 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 96; >+use Test::More tests => 98; > > use DateTime; > >@@ -460,6 +460,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); > my $now = dt_from_string(); > my $five_weeks = DateTime::Duration->new(weeks => 5); > my $five_weeks_ago = $now - $five_weeks; >+ t::lib::Mocks::mock_preference('finesMode', 'production'); > > my $passeddatedue1 = AddIssue($renewing_borrower, $barcode7, $five_weeks_ago); > is (defined $passeddatedue1, 1, "Item with passed date due checked out, due date: " . $passeddatedue1->date_due); >@@ -489,10 +490,11 @@ C4::Context->dbh->do("DELETE FROM accountlines"); > $new_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } ); > is ($new_log_size, $old_log_size + 1, 'renew log successfully added'); > >- >- $fine = $schema->resultset('Accountline')->single( { borrowernumber => $renewing_borrower->{borrowernumber}, itemnumber => $itemnumber7 } ); >- is( $fine->accounttype, 'F', 'Fine on renewed item is closed out properly' ); >- $fine->delete(); >+ my $fines = Koha::Account::Lines->search( { borrowernumber => $renewing_borrower->{borrowernumber}, itemnumber => $itemnumber7 } ); >+ is( $fines->count, 2 ); >+ is( $fines->next->accounttype, 'F', 'Fine on renewed item is closed out properly' ); >+ is( $fines->next->accounttype, 'F', 'Fine on renewed item is closed out properly' ); >+ $fines->delete(); > > t::lib::Mocks::mock_preference('OverduesBlockRenewing','blockitem'); > ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber6); >-- >2.1.4
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 18802
:
64286
|
64829
|
65327
|
65375
|
65488