From e9caf93ad51874333348cf784c8e569793fec554 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Thu, 3 Dec 2020 10:41:47 +0200 Subject: [PATCH] Bug 26405: Prevent Circulation.t failing on 'AddRenewal left both fines' Bug 23051 added option to skip calculating fines even when "CalculateFinesOnReturn" is enabled. Due this Circulation.t fails on test "AddRenewal left both fines" if "CalculateFinesOnReturn" is disabled on ones system. Mocking syspref while testing fixes failig tests. To test: 1. Disable "CalculateFinesOnReturn". 2. Run prove t/db_dependent/Circulation.t => Tests fail 3. Apply patch. 4. Run prove t/db_dependent/Circulation.t again => Tests are succesful Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart (cherry picked from commit 95cbefe12d5b5d901d545b602627224dfc2c7034) Signed-off-by: Fridolin Somers --- t/db_dependent/Circulation.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 35886c6dba..46d629d65f 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -695,6 +695,9 @@ subtest "CanBookBeRenewed tests" => sub { } ); + # Make sure fine calculation isn't skipped when adding renewal + t::lib::Mocks::mock_preference('CalculateFinesOnReturn', 1); + t::lib::Mocks::mock_preference('RenewalLog', 0); my $date = output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); my %params_renewal = ( -- 2.39.5