Summary: | TestBuilder does not allow undef/NULL values | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, m.de.rooy, mtompset |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Attachments: | Bug 16331: TestBuilder - Allow undef/NULL as a valid value |
Description
Jonathan Druart
2016-04-25 09:04:49 UTC
Created attachment 50614 [details] [review] Bug 16331: TestBuilder - Allow undef/NULL as a valid value When building new entities with TestBuilder, sometimes we would like to assign undef to a value. See bug 16276 patch 4 - Change to GetBorrowersToExpunge to take last_seen into account for a use case. Test plan: Confirm that the TestBuilder tests still pass prove t/db_dependent/TestBuilder.t doesn't pass in master before patch. This makes testing hard. Yep kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ prove t/db_dependent/TestBuilder.t t/db_dependent/TestBuilder.t .. 3/41 DBD::mysql::st execute failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_kohadev`.`edifact_messages`, CONSTRAINT `emfk_basketno` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`)) [for Statement "DELETE FROM `aqbasket` WHERE ( `basketno` = ? )" with ParamValues: 0='17'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. DBIx::Class::Storage::DBI::_dbh_execute(): Cannot delete or update a parent row: a foreign key constraint fails (`koha_kohadev`.`edifact_messages`, CONSTRAINT `emfk_basketno` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`)) at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 92 DBIx::Class::Storage::TxnScopeGuard::DESTROY(): A DBIx::Class::Storage::TxnScopeGuard went out of scope without explicit commit or error. Rolling back. at /usr/share/perl5/DBIx/Class/Exception.pm line 77 Can't really test (fails before patch) Jonathan: Please check bug 16155. It already includes this point and more. (In reply to M. Tompsett from comment #2) > prove t/db_dependent/TestBuilder.t doesn't pass in master before patch. This > makes testing hard. I have let a comment on bug 15630. To make them pass, you can remove the 3 FK on the edifact_messages table. (In reply to Marcel de Rooy from comment #4) > Jonathan: Please check bug 16155. It already includes this point and more. I needed a quick solution to build my tests, and this is a 2 lines patch. (In reply to Marcel de Rooy from comment #4) > Jonathan: Please check bug 16155. It already includes this point and more. Bug 16155 is pushed to master. I confirm that it fixes this bug. |