From 4d1d56c4b6cc837bc48c45e5fbb0113a90cd4e99 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Dec 2016 17:09:21 +0100 Subject: [PATCH] Bug 17733: Fix Members.t Content-Type: text/plain; charset=utf-8 In some dirty DB (Jenkins), the borrowers.guarantorid field is not set to a valid patron id. That make some tests fail if we create a patron with that patron id. In my DB, auto increment for borrowers is set to 52 before the tests On the 4th run of the tests, some tests fail. Before I got a patron with a guarantorid=112 (I let you do the math). Test plan: The easiest is to trust me Todo: Add a FK! Signed-off-by: Katrin Fischer Signed-off-by: Marcel de Rooy Opened a new report for special case: Bug 17759. --- t/db_dependent/Members.t | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t index 998c64f..df309f3 100755 --- a/t/db_dependent/Members.t +++ b/t/db_dependent/Members.t @@ -294,6 +294,11 @@ $builder->build({ }, }); +# In some dirty DB, the guarantorid is set to a non existent patron id +# If we pick it, then the tests will fail +# This should not be needed, we should have a FK on the guarantorid instead +Koha::Patrons->search({ guarantorid => { -in => [ $borrower1->{borrowernumber}, $borrower2->{borrowernumber} ] }})->update({ guarantorid => undef }); + my $owner = AddMember (categorycode => 'STAFFER', branchcode => $library2->{branchcode} ); my $list1 = AddPatronList( { name => 'Test List 1', owner => $owner } ); my @listpatrons = ($bor1inlist, $bor2inlist); -- 2.1.4