From cc0d0028e92ae07117b6307228ab88297b861512 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 4 Jun 2021 15:36:59 +0200 Subject: [PATCH] Bug 28516: Prevent failures if borrower_attribute_types.mandatory=1 TestBuilder will generate an integer for the Koha::Patron::Attribute::Type object, but if 1 is picked some tests are failing randomly At least t/db_dependent/Koha/Patrons.t and t/db_dependent/Koha/Patrons/Import.t The expection "Missing mandatory extended attribute" is raised when the patron is stored. Test plan: The following script should return 0 when the patch is applied: """ use t::lib::TestBuilder; my $builder = t::lib::TestBuilder->new; my $x = $builder->build_object( { class => 'Koha::Patron::Attribute::Types', } ); say $x->mandatory; """ Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 7fef05b641520c08dbc14361fc813b62e220bbdc) Signed-off-by: Fridolin Somers --- t/lib/TestBuilder.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index d8897b8145..ee375425af 100644 --- a/t/lib/TestBuilder.pm +++ b/t/lib/TestBuilder.pm @@ -592,7 +592,10 @@ sub _gen_default_values { }, AuthHeader => { marcxml => '', - } + }, + BorrowerAttributeType => { + mandatory => 0, + }, }; } -- 2.39.5