Bug 31493 - Circulation.t fails if "RenewalPeriodBase" is set as "the current date"
Summary: Circulation.t fails if "RenewalPeriodBase" is set as "the current date"
Status: RESOLVED DUPLICATE of bug 31676
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Emmi Takkinen
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-31 08:33 UTC by Emmi Takkinen
Modified: 2023-05-04 11:51 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 31493: Prevent Circulation.t failing on "AddRenewal left both fines" (1.36 KB, patch)
2022-08-31 09:17 UTC, Emmi Takkinen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emmi Takkinen 2022-08-31 08:33:16 UTC
Like in bug 26405 Circulation.t fails on the following error:

t/db_dependent/Circulation.t .. 15/63 
    #   Failed test 'AddRenewal left both fines'
    #   at t/db_dependent/Circulation.t line 770.
    #          got: '1'
    #     expected: '2'
    # Looks like you planned 105 tests but ran 30.
    # Looks like you failed 1 test of 30 run.
t/db_dependent/Circulation.t .. 17/63 
#   Failed test 'CanBookBeRenewed tests'
#   at t/db_dependent/Circulation.t line 1538.
Can't call method "status" on an undefined value at t/db_dependent/Circulation.t line 772.

Apparently this is happens when syspref "RenewalPeriodBase" is set as "the current date".
Comment 1 Emmi Takkinen 2022-08-31 09:17:59 UTC
Created attachment 139995 [details] [review]
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
Comment 2 Jonathan Druart 2023-05-04 11:49:25 UTC
Tests are passing for me without the patch, can you have another look please?
Comment 3 Jonathan Druart 2023-05-04 11:51:41 UTC
Might have been fixed by bug 31676.

*** This bug has been marked as a duplicate of bug 31676 ***