Bug 31110

Summary: Use `_should_be_fk` for ReturnClaim in TestBuilder
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Test SuiteAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 29495    
Bug Blocks:    
Attachments: Bug 31110: Move 'ReturnClaim.issue_id' to _should_be_fk

Description Martin Renvoize (ashimema) 2022-07-06 14:56:21 UTC
In bug 29495 we added a follow-up to fix the TestBuilder test.  However, we added the change to the wrong place; Instead of forcing undefined in the test data and not creating a link, we should add the field lacking a proper foreign key to the list in _should_be_fk

These are deliberately not foreign keys because they link to one of two tables.. the original and old_ version tables.. but we do add dbix::class relations for the link.
Comment 1 Martin Renvoize (ashimema) 2022-07-06 15:02:03 UTC
Created attachment 137216 [details] [review]
Bug 31110: Move 'ReturnClaim.issue_id' to _should_be_fk

This patch moves the issue_id field definition for ReturnClaim in
TestBuilder to the list of 'fake' keys in _should_be_fk.

Test plan
1) Run t/db_dependent/TestBuilder.t before applying the patch
2) Run t/db_dependent/TestBuilder.t after applying the patch
3) Signoff if the test passes both times.
Comment 2 Tomás Cohen Arazi (tcohen) 2022-07-06 15:31:01 UTC
It doesn't apply on master, and when fixing it I get the error for CheckoutRenewal back!
Comment 3 Martin Renvoize (ashimema) 2022-07-06 17:27:10 UTC
Weird.. it passed before we made the same change for CheckoutRenewals.. seems we can't add the same thing twice.

We can certainly leave this one as is for now..