Bugzilla – Attachment 101631 Details for
Bug 21443
Add ability to exclude holidays when calculating rentals fees by time period
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21443: (RM follow-up) Fix failing tests
Bug-21443-RM-follow-up-Fix-failing-tests.patch (text/plain), 7.60 KB, created by
Martin Renvoize (ashimema)
on 2020-03-24 16:28:31 UTC
(
hide
)
Description:
Bug 21443: (RM follow-up) Fix failing tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-03-24 16:28:31 UTC
Size:
7.60 KB
patch
obsolete
>From 2b8900e62c40e78d9b9ea1ab59880a382ca22ca8 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 24 Mar 2020 16:25:07 +0000 >Subject: [PATCH] Bug 21443: (RM follow-up) Fix failing tests > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Circulation.t | 37 ++++++++++++++++++------------------ > 1 file changed, 19 insertions(+), 18 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 6d7e4b4c92..0c21d2f5ad 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -3506,9 +3506,10 @@ subtest 'Incremented fee tests' => sub { > { > class => 'Koha::ItemTypes', > value => { >- notforloan => undef, >- rentalcharge => 0, >- rentalcharge_daily => 1, >+ notforloan => undef, >+ rentalcharge => 0, >+ rentalcharge_daily => 1, >+ rentalcharge_daily_calendar => 0 > } > } > )->store; >@@ -3531,34 +3532,34 @@ subtest 'Incremented fee tests' => sub { > my $dt_to_renew = $now->clone->add( days => 13 ); > > # Daily Tests >- t::lib::Mocks::mock_preference( 'finesCalendar', 'ignoreCalendar' ); > my $issue = > AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); > my $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount+0, 7, >-"Daily rental charge calculated correctly with finesCalendar = ignoreCalendar" >+"Daily rental charge calculated correctly with rentalcharge_daily_calendar = 0" > ); > $accountline->delete(); > AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount+0, 6, >-"Daily rental charge calculated correctly with finesCalendar = ignoreCalendar, for renewal" >+"Daily rental charge calculated correctly with rentalcharge_daily_calendar = 0, for renewal" > ); > $accountline->delete(); > $issue->delete(); > > t::lib::Mocks::mock_preference( 'finesCalendar', 'noFinesWhenClosed' ); >+ $itemtype->rentalcharge_daily_calendar(1)->store(); > $issue = > AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount+0, 7, >-"Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed" >+"Daily rental charge calculated correctly with rentalcharge_daily_calendar = 1" > ); > $accountline->delete(); > AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount+0, 6, >-"Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed, for renewal" >+"Daily rental charge calculated correctly with rentalcharge_daily_calendar = 1, for renewal" > ); > $accountline->delete(); > $issue->delete(); >@@ -3579,13 +3580,13 @@ subtest 'Incremented fee tests' => sub { > AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount+0, 6, >-"Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed $closed_day_name" >+"Daily rental charge calculated correctly with rentalcharge_daily_calendar = 1 and closed $closed_day_name" > ); > $accountline->delete(); > AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount+0, 5, >-"Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed $closed_day_name, for renewal" >+"Daily rental charge calculated correctly with rentalcharge_daily_calendar = 1 and closed $closed_day_name, for renewal" > ); > $accountline->delete(); > $issue->delete(); >@@ -3628,31 +3629,31 @@ subtest 'Incremented fee tests' => sub { > $dt_to = $now->clone->add( hours => 168 ); > $dt_to_renew = $now->clone->add( hours => 312 ); > >- t::lib::Mocks::mock_preference( 'finesCalendar', 'ignoreCalendar' ); >+ $itemtype->rentalcharge_hourly_calendar(0)->store(); > $issue = > AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount + 0, 42, >- "Hourly rental charge calculated correctly with finesCalendar = ignoreCalendar (168h * 0.25u)" ); >+ "Hourly rental charge calculated correctly with rentalcharge_hourly_calendar = 0 (168h * 0.25u)" ); > $accountline->delete(); > AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount + 0, 36, >- "Hourly rental charge calculated correctly with finesCalendar = ignoreCalendar, for renewal (312h - 168h * 0.25u)" ); >+ "Hourly rental charge calculated correctly with rentalcharge_hourly_calendar = 0, for renewal (312h - 168h * 0.25u)" ); > $accountline->delete(); > $issue->delete(); > >- t::lib::Mocks::mock_preference( 'finesCalendar', 'noFinesWhenClosed' ); >+ $itemtype->rentalcharge_hourly_calendar(1)->store(); > $issue = > AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount + 0, 36, >- "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed $closed_day_name (168h - 24h * 0.25u)" ); >+ "Hourly rental charge calculated correctly with rentalcharge_hourly_calendar = 1 and closed $closed_day_name (168h - 24h * 0.25u)" ); > $accountline->delete(); > AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount + 0, 30, >- "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed $closed_day_name, for renewal (312h - 168h - 24h * 0.25u" ); >+ "Hourly rental charge calculated correctly with rentalcharge_hourly_calendar = 1 and closed $closed_day_name, for renewal (312h - 168h - 24h * 0.25u" ); > $accountline->delete(); > $issue->delete(); > >@@ -3661,12 +3662,12 @@ subtest 'Incremented fee tests' => sub { > AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount + 0, 42, >- "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed (168h - 0h * 0.25u" ); >+ "Hourly rental charge calculated correctly with rentalcharge_hourly_calendar = 1 (168h - 0h * 0.25u" ); > $accountline->delete(); > AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); > is( $accountline->amount + 0, 36, >- "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed, for renewal (312h - 168h - 0h * 0.25u)" ); >+ "Hourly rental charge calculated correctly with rentalcharge_hourly_calendar = 1, for renewal (312h - 168h - 0h * 0.25u)" ); > $accountline->delete(); > $issue->delete(); > Time::Fake->reset; >-- >2.20.1
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 21443
:
100402
|
100403
|
100404
|
100405
|
100744
|
100745
|
100746
|
100747
|
100748
|
101428
|
101429
|
101430
|
101431
|
101458
|
101459
|
101460
|
101461
|
101462
|
101463
|
101464
|
101465
|
101466
|
101467
|
101468
|
101469
| 101631