This test fails if Koha has a cash register defined already, with ID=1. To reproduce: 1. Fire up a fresh KTD 2. Add a cash register (needs UseCashRegisters enabled) 3. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/cashups.t => FAIL: Expecting a 404 ("Register not found"), getting a 200.
Created attachment 164285 [details] [review] Bug 36493: Make cashups test more robust This patch makes the test independent from existing cash registers in the system. To test: 1. Enable UseCashRegisters on a fresh KTD 2. Add a cash register 3. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/cashups.t => FAIL: Tests fail! 4. Apply this patch 5. Repeat 3 => SUCCESS: Tests pass! 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 164288 [details] [review] Bug 36493: Make cashups test more robust This patch makes the test independent from existing cash registers in the system. To test: 1. Enable UseCashRegisters on a fresh KTD 2. Add a cash register 3. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/cashups.t => FAIL: Tests fail! 4. Apply this patch 5. Repeat 3 => SUCCESS: Tests pass! 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. The first cash register created doesn't always have an ID of 1. 2. I had to update the database manually to have one with an ID of 1: - Access the database: koha-mysql kohadev - Get a list of cash registers: select * from cash_registers; - Update the cash register ID (XXXXX = the name of the cash register from the first query): update cash_registers set id=1 where name="XXXXX";
Created attachment 164788 [details] [review] Bug 36493: Make cashups test more robust This patch makes the test independent from existing cash registers in the system. To test: 1. Enable UseCashRegisters on a fresh KTD 2. Add a cash register 3. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/cashups.t => FAIL: Tests fail! 4. Apply this patch 5. Repeat 3 => SUCCESS: Tests pass! 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.06
Backported to 23.05.x for upcoming 23.05.12