From c2a13cc554eed3baf1ae10f92261158eb13a386f Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Wed, 31 Aug 2022 12:13:25 +0300 Subject: [PATCH] Bug 31493: Prevent Circulation.t failing on "AddRenewal left both fines" If one has syspref "RenewalPeriodBase" set as "the current date" Circulation.t tests fail on "AddRenewal left both fines". This causes one of the test fines to be dropped/charged. Mocking syspref "RenewalPeriodBase" as "the old due date of the checkout" solves the issue. To test: 1. Have syspref "RenewalPeriodBase" set as "the current date". 2. Run prove t/db_dependent/Circulation.t. => Tests fail. 3. Apply patch. 4. Run tests again. => Tests pass. Sponsored-by: Koha-Suomi Oy --- t/db_dependent/Circulation.t | 1 + 1 file changed, 1 insertion(+) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 28c3238301..4ad6cad45a 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -732,6 +732,7 @@ 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('RenewalPeriodBase', 'date_due'); my $staff = $builder->build_object({ class => "Koha::Patrons" }); t::lib::Mocks::mock_userenv({ patron => $staff }); -- 2.34.1