[Koha-bugs] [Bug 31676] Fix db_dependent/Circulation.t tests

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 5 16:34:29 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31676

--- Comment #3 from David Gustafsson <glasklas at gmail.com> ---
Ok, that's strange. I think most of the test failing for me could pass with
certain sysprefs set, but at least the one where two account lines are expected
I just can't figure out how it would ever do so.

In this test an item is issued with due date five weeks ago, UpdateFine is then
run which creates an account line with type "OVERDUE" and status "UNRETURNED"
(line 722 in current master). AddRenewal is then called twice for this item in
turn calling _CalculateAndUpdateFine which checks for a fine calling CalcFine
and then possibly calling UpdateFine if got a fine amount.

In the first call to AddRenewal the due date is five weeks in the past, so
CalcFine will return a fine. UpdateFine is then called which will fetch the
account line and adjust the amount (to the same value as before), then calling
_FixOverduesOnReturn which sets the account line status to "RENEWED". Due date
for the issue is then set to a date in the future.

In the second call CalcFine will not return a fine since due date is in the
future thus UpdateFine is not called (which I have also verified in my
instance).

I just can't figure out how UpdateFine could ever add more than one account
line in this test case. I also don't see any sysprefs or other state that is
not already mocked which could effect AddRenewal behavior. Obviously since the
tests work for you there should be such a case, but personally I can't figure
out how to reproduce it. I also tried resetting all sysprefs to default values
but this test still fails. From what I can see circulation rules are also
cleared before running the tests so existing ones should not effect the
results. The docker setup currently running koha on makes it very cumbersome to
completely reset the koha instance to a completely clean installation, but if I
had access to an instance where the tests do indeed pass it would probably be
trial to find out what is causing this issue.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list