From 3c244c6f6009c5a1ada73963d5008f78ef3f6281 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. Signed-off-by: David Nind Signed-off-by: Katrin Fischer --- 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 c27dfc405f..37214105e5 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.30.2