prove /kohadevbox/koha/t/db_dependent/Koha/Item.t
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This patch adds unit tests to confirm that the 773 record created by
Koha::Biblio now takes account of RDA updates and subfield ordering.
Test plan
1. Apply patch
2. Run `prove ./t/db_dependent/Koha/Biblio.t`.
3. Test fails.
4. Apply next patch in series
5. Run `prove ./t/db_dependent/Koha/Biblio.t`.
6. All tests pass.
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
In order to remove false positives with the QA script we should replace some tabs with spaces.
There are more but I wanted to make sure no regression would be
introduced
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Test plan:
1) Apply this test patch. Run. Verify it fails
2) Apply other patch. Run. Verify it passes.
prove t/db_dependent/api/v1/patrons.t
Verify no other regressions are introduced, run:
prove t/db_dependent/Koha/Patron/Attribute.t
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Due to a bad rebase we ended up changing subtest names in commit 1b4bb57092
This patch restores them and has no effect on the tests themselves.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Test plan:
select count(*) from itemtypes;
run the tests
exectute the select query again
=> No itemtypes should have been created
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
- Rename LanguageToReportOnMerge system preference to LanguageToUseOnMerge
- Use "use" instead of "report" in system preference description
- Mark this feature as UNIMARC-only.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch makes the method return an actual array instead of a
comma-separated string. The API spec is adjusted so it also expects an
array in the response.
Tests are adjusted for the new return value.
To test:
1. Apply this patch
2. Run:
$ ktd --shell
k$ yarn api:bundle
k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan:
1. Tests should pass: prove t/db_dependent/Koha/Item.t
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a strings_map method to allow the API to return the required authorised values needed for table displays
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This fixes the holds queue and associated tests.
I also updated the sql file to fix an issue and the LocalHoldsPriority tests to fix a typo.
I'm working on final unit tests for the holds queue for all the options for QA but I wanted to get the queue changes ready for sign-off.
UPDATED TEST PLAN
This patch adds new options to the LocalHoldsPriority system preference to allow for the following options:
'None' the equivalent to 'Don't' pre-patch
'GiveLibrary' the equivalent to 'Do' pre-patch
'GiveLibraryAndGroup' Allows for checking the library first, then hold groups
'GiveGroup' Allows to prioritize within a group without prioritizing any library first.
The included patches will update the preference in existing installations to maintain current behavior.
To Test:
BEFORE APPLYING THE PATCH
/Tip/
I kept the following tabs open:
-The holds screen (for suspending, checking order, etc)
-Check in screen (can ignore holds to keep them all in place)
-Holds to Pull with "All" for Libraries
-System Preferences
/Setup Groups and confirm current behavior/
1. Set the following system preferences:
-" LocalHoldsPriority " system preference to "Give"
-"LocalHoldsPriorityPatronControl" to "home library"
-"LocalHoldsPriorityItemControl" to "home library"
-"RealTimeHoldsQueue" to "Enable"
2. Create 2 Library Groups
- Set them to be hold groups
- I called mine group 1 & group 2
3. Add 2 libraries each to each group.
- Group 1
- Centerville
- Fairfield
- Group 2
- Fairview
- Franklin
4. Find a patron for each branch in the groups
- Centerville - Changed 23529000035676 (Henry)
- Fairfield - Changed 23529000050113 (Jordan)
- Fairview - Changed 23529001000463 (Edna)
- Franklin - 23529000121682 (Nicole)
5. Find a record with at least 2 items
6. If needed change the home and holding libraries so you have at least one item for each hold group
- Centerville - 39999000000252
- Fairview - Changed 39999000000238
7. Place 2 record level holds for the record.
- One for 23529000035676 (Henry) for pickup at Centerville (Priority 1)
- One for 23529001000463 (Edna) for pickup at Fairview (Priority 2)
8. Check in 39999000000238. The hold popup should be for the second hold (Henry), not the first (Edna.) Ignore the hold
9. Edit the record then save to trigger real time queue update
10. On the Holds Queue (submit after each set of changes):
- Centerville should be for Henry
- Fairview should be for Edna
/apply patch and confirm behavior still works/
10. Apply patch
11. Rebuild the database then restart_all (in sandboxes it's an action, in ktd " dbic && updatedatabase && restart_all ")
12. Confirm that " LocalHoldsPriority " is set to "Give Library"
13. Repeat steps 8-10, behavior should be the same.
/ check library then library group setting/
14. Change " LocalHoldsPriority " to "Give library then library group"
15. Set the following record level holds for the record in the following order:
*You can add Jordan and Nicole's, then rearrange the order.
- Pickup at Fairfield - 23529000050113 (Jordan)
- Pickup at Franklin - 23529000121682 (Nicole)
- Pickup at Centerville - 23529000035676 (Henry)
- Pickup at Fairview - 23529001000463 (Edna)
17. Check in 39999000000252 - should try and fill to Centerville - 23529000035676 (Henry)
17. Check in 39999000000238 - should try and fill to Fairview - 23529001000463 (Edna)
18. On the Hold Queue:
- Centerville should be for Henry
- Fairview should be for Edna
19. Suspend the hold for 23529001000463 (Edna)
20. Check in 39999000000238 should try and fill to 23529000121682 (Nicole) (ignore the hold)
21. On the Holds Queue:
- Centerville should be for Henry
- Fairview should be for Nicole
/ check library group setting /
22. Reset the holds to match step 15.
23. Change " LocalHoldsPriority " to "Give group"
24. Check in 39999000000252 - should try and fill to Fairfield (Jordan) (ignore the hold)
25. Check in 39999000000238 - should try and fill to Franklin (Nicole) (ignore the hold)
26. On the Holds Queue:
- Centerville should be for Jordan
- Fairview should be for Nicole
/check no priority /
27. Change " LocalHoldsPriority " to "Don't give"
28. Reset the holds to match step 15.
29. Check in 39999000000238 - Should fill to Fairfield (Jordan) (ignore the hold)
30. Check in 39999000000252 - Should fill to Fairfield hold (Jordan) (ignore the hold)
31. On the Holds Queue:
- Centerville should be for Jordan
- Fairview should be for Nicole
/Also check/
Item level holds behave as expected
Different combinations of LocalHoldsPriorityItemControl and LocalHoldsPriorityPatronControl
Sponsored by: Cape Libraries Automated Materials Sharing
Sponsored by: Northeast Kansas Library System (NEKLS)
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds new options to the LocalHoldsPriority system preference to allow for the following options:
'None' the equivalent to 'Don't' pre-patch
'GiveLibrary' the equivalent to 'Do' pre-patch
'GiveLibraryAndGroup' Allows for checking the library first, then hold groups
'GiveGroup' Allows to prioritize within a group without prioritizing any library first.
The included patches will update the preference in existing installations to maintain current behavior.
To Test:
BEFORE APPLYING THE PATCH
/Setup Groups and confirm current behavior/
1. Set the " LocalHoldsPriority " system preference to "Give", "LocalHoldsPriorityPatronControl" to "home library" and "LocalHoldsPriorityItemControl" to "home library"
2. Create 2 Library hold Groups
- I called mine group 1 & group 2
3. Add 2 libraries each to each group.
- Group 1
- Centerville
- Fairfield
- Group 2
- Fairview
- Franklin
4. Find a patron for each branch in the groups
- Centerville - 23529000035676 (Henry)
- Fairfield - Changed 23529000050113
- Fairview - Changed 23529001000463 (Edna)
- Franklin - 23529000121682
5. Find a record with at least 2 items
6. If needed change the home and holding libraries so you have at least one item for each hold group
- Centerville - 39999000000252
- Fairview - Changed 39999000000238
7. Place 2 record level holds for the record.
- One for 23529000035676 for pickup at Centerville (Priority 1)
- One for 23529001000463 for pickup at fairview (Priority 2)
8. Check in 39999000000238. The hold popup should be for the second hold, not the first.
/apply patch and confirm behavior still works/
9. Apply patch
10. Rebuild the database then restart_all (in sandboxes it's an action, in ktd " dbic && updatedatabase && restart_all ")
11. Confirm that " LocalHoldsPriority " is set to "Give Library"
12. Repeat steps 7-8, behavior should be the same.
/ check library then library group setting/
13. Change " LocalHoldsPriority " to "Give library then library group"
14. Set the following record level holds for the record:
- Pickup at Fairfield - 23529000050113
- Pickup at Franklin - 23529000121682
- Pickup at Centerville - 23529000035676 (Henry)
- Pickup at Fairview - 23529001000463 (Edna)
15. Check in 39999000000252 - should try and fill to Centerville - 23529000035676 (Henry)
16. Check in 39999000000238 - should try and fill to Fairview - 23529001000463 (Edna)
17. Cancel the hold for 23529001000463
18. Check in 39999000000238 should try and fill to 23529000121682
/ check library group setting /
19. Reset the holds to match step 14.
20. Check in 39999000000252 - should try and fill to Fairfield
21. Check in 39999000000238 - should try and fill to Franklin
/check no priority /
22. Reset the holds to match step 14.
23. Check in 39999000000238 - Should fill the Fairfield hold
24. Check in 39999000000252 - Should fill the Franklin hold
/Also check/
Item level holds behave as expected
Different combinations of LocalHoldsPriorityItemControl and LocalHoldsPriorityPatronControl
Sponsored by: Cape Libraries Automated Materials Sharing
Sponsored by: Northeast Kansas Library System (NEKLS)
Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37334: Adjust number of tests in Items.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
NB, some previous test had to be adjusted to make it posible to call
search_auth_compat in _search and properly interpret its results.
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
When building queries for matchign Zebra uses OR to combine searches - Elasticsearch
has been effectively using 'AND' - this patch checks whether and_or has been passed
and follows the variable when present.
To test:
1 - Have an import file of auths with multiple 035
2 - Setup an authority matching rule
Search index: other-control-number
Score: 1000
Tag: 035
Subfields: a
3 - Make sure Koha is using Elasticsearch
4 - Stage file without matching, import file
5 - Stage file again, using your matching rule
6 - Note all records match
7 - Setup Cataloging->Marc modification template
8 - Add an action to delete first 035 field
9 - Run it against the records you just imported
You can use a report:
SELECT authid FROM auth_header WHERE authid > #### (find the lowest new record number in batch you imported)
10 - Change matching rule in batch to none, then back to your rule
11 - No matches!
12 - Apply patch, restart all
13 - Set matchign rule to none, then back to your rule
14 - Matches!
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised!
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
If DefaultHoldExpirationdate is on and DefaultHoldExpirationdatePeriod
is blank, the blank is treated as a zero and all holds are created
with an expiration date of today.
This patch changes expiration dates storing so that if
DefaultHoldExpirationdatePeriod is left blank, expiration date is not
set. Users are informed about this with a note in syspref.
To test:
1. Set DefaultHoldExpirationdate on but leave
DefaultHoldExpirationdatePeriod blank.
2. Add hold for patron.
=> Note that expiration date is set as today.
3. Apply this patch
=> Confirm following note is now added after sysprefs:
"NOTE: If DefaultHoldExpirationdatePeriod is left blank
default expiration date is not set."
4. Add new hold for patron.
=> Note that expiration date is not set.
Also prove t/db_dependent/Hold.t.
Sponsored-by: Koha-Suomi Oy
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
We alter how the options are added to the patrons_search datatables
search bar, but we didn't update the selenium test to match.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch does:
* Mock `CanItemBeReserved` and `CanBookBeReserved` to better control the
test scenario and make it agnostic from existing data.
* Adds tests for the item-level group holds use case
* Adds tests for the warnings printed when placing the hold should not
be possible
To test:
1. Apply this patch
2. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1/clubs_holds.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
We change the page title in the templates, but didn't update the
corrseponding selenium test
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a new preference 'CardnumberLog' which allows libraries
to track cardnumebr changes for patrons.
While these changes are currently captured in the BorrowersLog, some libraries
would like to keep cardnumber chanegs specifically, and for a longer period than
other borrower modifications.
To test:
1 - Apply patches, update database
2 - Ensure BorrowersLog and CardnumberLog are enabled
3 - Edit a borrower, not thier cardnuber
4 - Confirm in Modification Log only one entry is recorded
5 - Edit again, changing cardnumber only
6 - Confirm 2 modifications are recorded, a MODIFY and a MODIFY_CARDNUMBER
7 - Disable BorrowersLog
8 - Edit patron changing something other than cardnumber
9 - Confirm no log generated
10 - Edit borrowers cardnumber
11 - Confirm one MODIFY_CARDNUMBER recorded
12 - Disable CardnumberLog
13 - Edit patrons cardnumber and other fields
14 - Confirm no logs generated
Signed-off-by: Philip Orr <philip.orr@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
These tests should test an authenticated patron, without the presence of a cardnumber in the metadata (as it is the case in the OPAC form)
This is also the reason why we mock_userenv right below this.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit (tcohen): Tidied the file...
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
After pushing bug 38356 to main, Circulation.t tests
started to fail. Fail happened randomly and was related
to sub is_serial trying to fetch biblios metadata. This
patch changes the way test item is build in
"CanBookBeIssued + needsconfirmation message" tests. It
seems more reliable to use build_sample_item rather than
building item using biblio and biblioitem data.
To test prove t/db_dependent/Circulation.t.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 26176 renamed 'AutoLocation' to 'StaffLoginRestrictLibraryByIP'
Needs to be fixed in test suite
Test plan:
Enable 'StaffLoginRestrictLibraryByIP' in prefs
Run : prove Auth.t
Should pass
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Correct preference is 'DefaultHoldExpirationdateUnitOfTime'.
Also no reason for ";".
Test by running : prove t/db_dependent/Reserves.t
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Typo in system preference call 'OPACFineNoRenewalsIncludeCredit'
=> 'OPACFineNoRenewalsIncludeCredits'
Test plan :
Run : prove t/db_dependent/Circulation.t
Run test plan of Bug 23293
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>