Bugzilla – Attachment 137952 Details for
Bug 31201
Pseudonymization.t failing if selenium/patrons_search.t failed before
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31201: Prevent Pseudonymization.t to fail
Bug-31201-Prevent-Pseudonymizationt-to-fail.patch (text/plain), 2.98 KB, created by
Jonathan Druart
on 2022-07-21 05:18:29 UTC
(
hide
)
Description:
Bug 31201: Prevent Pseudonymization.t to fail
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-07-21 05:18:29 UTC
Size:
2.98 KB
patch
obsolete
>From 0ac26fbcd521a06bebc4a03c529e6e51ce9c5ddb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Jul 2022 17:44:05 +0200 >Subject: [PATCH] Bug 31201: Prevent Pseudonymization.t to fail > >It's failing if selenium/patrons_search.t failed before, they are using >the same code and the selenium tests didn't clean correctly >--- > t/db_dependent/Koha/Pseudonymization.t | 39 +++++++++++++++----------- > 1 file changed, 22 insertions(+), 17 deletions(-) > >diff --git a/t/db_dependent/Koha/Pseudonymization.t b/t/db_dependent/Koha/Pseudonymization.t >index 674ad36bf1a..9ee23ceaa32 100755 >--- a/t/db_dependent/Koha/Pseudonymization.t >+++ b/t/db_dependent/Koha/Pseudonymization.t >@@ -132,28 +132,31 @@ subtest 'PseudonymizedBorrowerAttributes tests' => sub { > delete $patron_info->{borrowernumber}; > $patron->delete; > >- my $attribute_type1 = Koha::Patron::Attribute::Type->new( >+ my $attribute_type1 = $builder->build_object( > { >- code => 'my code1', >- description => 'my description1', >- repeatable => 1, >- keep_for_pseudonymization => 1, >+ class => 'Koha::Patron::Attribute::Types', >+ value => { >+ repeatable => 1, >+ keep_for_pseudonymization => 1, >+ } > } >- )->store; >- my $attribute_type2 = Koha::Patron::Attribute::Type->new( >+ ); >+ my $attribute_type2 = $builder->build_object( > { >- code => 'my code2', >- description => 'my description2', >- keep_for_pseudonymization => 0, >+ class => 'Koha::Patron::Attribute::Types', >+ value => { >+ keep_for_pseudonymization => 0, >+ } > } >- )->store; >- my $attribute_type3 = Koha::Patron::Attribute::Type->new( >+ ); >+ my $attribute_type3 = $builder->build_object( > { >- code => 'my code3', >- description => 'my description3', >- keep_for_pseudonymization => 1, >+ class => 'Koha::Patron::Attribute::Types', >+ value => { >+ keep_for_pseudonymization => 1, >+ } > } >- )->store; >+ ); > > $patron = Koha::Patron->new($patron_info)->store->get_from_storage; > my $attribute_values = [ >@@ -190,7 +193,9 @@ subtest 'PseudonymizedBorrowerAttributes tests' => sub { > ); > > my $p = Koha::PseudonymizedTransactions->search({itemnumber => $item->itemnumber})->next; >- my $attributes = Koha::Database->new->schema->resultset('PseudonymizedBorrowerAttribute')->search({transaction_id => $p->id }); >+ my $attributes = >+ Koha::Database->new->schema->resultset('PseudonymizedBorrowerAttribute') >+ ->search( { transaction_id => $p->id }, { order_by => 'attribute' } ); > is( $attributes->count, 2, > 'Only the 2 attributes that have a type with keep_for_pseudonymization set should be kept' > ); >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31201
:
137938
|
137952
|
137954