From 23b8839294b3e6b25a2660e504486585a992b005 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 8 Jun 2022 11:39:43 +0200 Subject: [PATCH] Bug 30399: Make Patron.t pass even if mandatory attributes exist t/db_dependent/Koha/Patron.t is failing if mandatory attributes already exist in the DB. We can make it pass easily by deleting all the attributes before we run the tests. Test plan: prove t/db_dependent/Koha/Patron.t must return green even if one mandatory patron attribute exists. --- t/db_dependent/Koha/Patron.t | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t index c27dfc405f4..37214105e52 100755 --- a/t/db_dependent/Koha/Patron.t +++ b/t/db_dependent/Koha/Patron.t @@ -377,6 +377,8 @@ subtest 'extended_attributes' => sub { my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; + Koha::Patron::Attribute::Types->search->delete; + my $patron_1 = $builder->build_object({class=> 'Koha::Patrons'}); my $patron_2 = $builder->build_object({class=> 'Koha::Patrons'}); @@ -507,6 +509,7 @@ subtest 'extended_attributes' => sub { plan tests => 3; $schema->storage->txn_begin; + Koha::Patron::Attribute::Types->search->delete; my $patron = $builder->build_object({ class => 'Koha::Patrons' }); my $attribute_type = $builder->build_object( @@ -541,6 +544,7 @@ subtest 'extended_attributes' => sub { plan tests => 5; $schema->storage->txn_begin; + Koha::Patron::Attribute::Types->search->delete; my $patron_1 = $builder->build_object({ class => 'Koha::Patrons' }); my $patron_2 = $builder->build_object({ class => 'Koha::Patrons' }); @@ -593,6 +597,7 @@ subtest 'extended_attributes' => sub { plan tests => 3; $schema->storage->txn_begin; + Koha::Patron::Attribute::Types->search->delete; my $patron = $builder->build_object({ class => 'Koha::Patrons' }); @@ -637,6 +642,7 @@ subtest 'extended_attributes' => sub { plan tests => 5; $schema->storage->txn_begin; + Koha::Patron::Attribute::Types->search->delete; my $patron = $builder->build_object({ class => 'Koha::Patrons' }); -- 2.25.1