Bug 32240 - api/erm_users.t fails if checkouts exist
Summary: api/erm_users.t fails if checkouts exist
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords: rel_22_11_candidate
Depends on: 32030
Blocks:
  Show dependency treegraph
 
Reported: 2022-11-17 08:51 UTC by Jonathan Druart
Modified: 2023-06-08 22:29 UTC (History)
2 users (show)

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


Attachments
Bug 32240: Prevent erm_users.t to fail if checkout exist (1.62 KB, patch)
2022-11-17 08:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32240: Prevent erm_users.t to fail if checkout exist (1.68 KB, patch)
2022-11-17 15:24 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2022-11-17 08:51:39 UTC
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_kohadev`.`issues`, CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON UPDATE CASCADE) at /kohadevbox/koha/Koha/Object.pm line 234
Comment 1 Jonathan Druart 2022-11-17 08:53:32 UTC
Created attachment 143985 [details] [review]
Bug 32240: Prevent erm_users.t to fail if checkout exist

We should not (never) remove all patrons before tests

Test plan:
0. Don't apply the patch
1. Check an item out
2. Run the tests
=> Fail
3. Apply the patch
4. Create a patron with the erm permission
5. Run the tests
=> Must return green
Comment 2 Martin Renvoize 2022-11-17 15:24:50 UTC
Created attachment 144005 [details] [review]
Bug 32240: Prevent erm_users.t to fail if checkout exist

We should not (never) remove all patrons before tests

Test plan:
0. Don't apply the patch
1. Check an item out
2. Run the tests
=> Fail
3. Apply the patch
4. Create a patron with the erm permission
5. Run the tests
=> Must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Tomás Cohen Arazi 2022-11-17 16:43:09 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!