Bugzilla – Attachment 148486 Details for
Bug 33284
checkout_renewals table retains checkout history in violation of patron privacy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33284: Unit test
Bug-33284-Unit-test.patch (text/plain), 2.13 KB, created by
Martin Renvoize (ashimema)
on 2023-03-21 17:04:15 UTC
(
hide
)
Description:
Bug 33284: Unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-03-21 17:04:15 UTC
Size:
2.13 KB
patch
obsolete
>From a738a7f0a4a27536b9b627c59a359802ab59d188 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 21 Mar 2023 15:01:08 +0000 >Subject: [PATCH] Bug 33284: Unit test > >--- > t/db_dependent/Koha/Old/Checkouts.t | 30 ++++++++++++++++++++++++++++- > 1 file changed, 29 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Old/Checkouts.t b/t/db_dependent/Koha/Old/Checkouts.t >index 2c7c52ad62..7254bcba8e 100755 >--- a/t/db_dependent/Koha/Old/Checkouts.t >+++ b/t/db_dependent/Koha/Old/Checkouts.t >@@ -32,7 +32,7 @@ my $builder = t::lib::TestBuilder->new; > > subtest 'anonymize() tests' => sub { > >- plan tests => 10; >+ plan tests => 13; > > $schema->storage->txn_begin; > >@@ -89,8 +89,28 @@ subtest 'anonymize() tests' => sub { > } > } > ); >+ my $renewal_1 = $builder->build_object( >+ { >+ class => 'Koha::Checkouts::Renewals', >+ value => { >+ checkout_id => $checkout_4->id, >+ interface => 'opac', >+ renewer_id => $patron->id >+ } >+ } >+ ); >+ my $renewal_2 = $builder->build_object( >+ { >+ class => 'Koha::Checkouts::Renewals', >+ value => { >+ checkout_id => $checkout_4->id, >+ interface => 'intranet' >+ } >+ } >+ ); > > is( $patron->old_checkouts->count, 4, 'Patron has 4 completed checkouts' ); >+ is( $checkout_4->renewals->count, 2, 'Checkout 4 has 2 renewals' ); > > # filter them so only the older two are part of the resultset > my $checkouts = $patron->old_checkouts->filter_by_last_update( >@@ -112,6 +132,14 @@ subtest 'anonymize() tests' => sub { > is( $anonymized_count, 2, 'update() tells 2 rows were updated' ); > > is( $patron->old_checkouts->count, 2, 'Patron has 2 completed checkouts' ); >+ is( $checkout_4->renewals->count, 2, 'Checkout 4 still has 2 renewals' ); >+ is( >+ $checkout_4->renewals->search( >+ { renewer_id => $anonymous_patron->id } >+ )->count, >+ 1, >+ 'OPAC renewal was anonymized' >+ ); > > $schema->storage->txn_rollback; > }; >-- >2.40.0
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 33284
:
148469
|
148486
|
148487
|
148670
|
148671
|
148672
|
148772
|
148773
|
148774
|
168596
|
168597
|
168598
|
168599