Bugzilla – Attachment 107457 Details for
Bug 23382
Issuing rules failing after bug 20912
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23382: (RM follow-up) Ensure tests pass on Wednesdays
Bug-23382-RM-follow-up-Ensure-tests-pass-on-Wednes.patch (text/plain), 3.86 KB, created by
Jonathan Druart
on 2020-07-28 08:04:18 UTC
(
hide
)
Description:
Bug 23382: (RM follow-up) Ensure tests pass on Wednesdays
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-07-28 08:04:18 UTC
Size:
3.86 KB
patch
obsolete
>From 3e7b87ff2566a89b0320fc1f77c33a898fa15e29 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 6 Nov 2019 14:45:12 +0000 >Subject: [PATCH] Bug 23382: (RM follow-up) Ensure tests pass on Wednesdays > >Koha::Calendar assumes we never issue an item on a closed day.. this is >a fair assumption but the hardcoded closed day in our tests means it >does not hold true in this case. > >This patch sets the closed day dynamically to prevent such a case. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Circulation.t | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index efc8514543..c26ca42394 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -3177,8 +3177,14 @@ subtest 'Incremented fee tests' => sub { > $issue->delete(); > > my $calendar = C4::Calendar->new( branchcode => $library->id ); >+ # DateTime 1..7 (Mon..Sun), C4::Calender 0..6 (Sun..Sat) >+ my $closed_day = >+ ( $dt_from->day_of_week == 6 ) ? 0 >+ : ( $dt_from->day_of_week == 7 ) ? 1 >+ : $dt_from->day_of_week + 1; >+ my $closed_day_name = $dt_from->clone->add(days => 1)->day_name; > $calendar->insert_week_day_holiday( >- weekday => 3, >+ weekday => $closed_day, > title => 'Test holiday', > description => 'Test holiday' > ); >@@ -3186,13 +3192,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, '6.000000', >-"Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" >+"Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed 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, '5.000000', >-"Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" >+"Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed $closed_day_name, for renewal" > ); > $accountline->delete(); > $issue->delete(); >@@ -3255,16 +3261,16 @@ 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, 36, >- "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays (168h - 24h * 0.25u)" ); >+ "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed 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 Wednesdays, for renewal (312h - 168h - 24h * 0.25u" ); >+ "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed $closed_day_name, for renewal (312h - 168h - 24h * 0.25u" ); > $accountline->delete(); > $issue->delete(); > >- $calendar->delete_holiday( weekday => 3 ); >+ $calendar->delete_holiday( weekday => $closed_day ); > $issue = > AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); > $accountline = Koha::Account::Lines->find( { itemnumber => $item->id } ); >-- >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 23382
:
92221
|
92222
|
92236
|
92237
|
92238
|
92273
|
92274
|
92275
|
92276
|
93407
|
93408
|
93409
|
93410
|
93411
|
93412
|
94281
|
94282
|
94283
|
94284
|
94285
|
94286
|
94287
|
94288
|
94289
|
94723
|
94724
|
94725
|
94726
|
94727
|
94728
|
94729
|
94730
|
94731
|
94743
|
94755
|
94756
|
94757
|
94758
|
94759
|
94760
|
94761
|
94762
|
94763
|
94764
|
94765
|
94766
|
94774
|
94775
|
94776
|
94777
|
94778
|
94779
|
94780
|
94781
|
94782
|
94783
|
94784
|
107456
| 107457