Bugzilla – Attachment 163248 Details for
Bug 16122
Item record needs to keep local use count
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16122: Add unit test
Bug-16122-Add-unit-test.patch (text/plain), 3.21 KB, created by
Andrew Fuerste-Henry
on 2024-03-15 14:32:51 UTC
(
hide
)
Description:
Bug 16122: Add unit test
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2024-03-15 14:32:51 UTC
Size:
3.21 KB
patch
obsolete
>From 939037fc765368b61f3b19976461e904456dafce Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 11 Mar 2024 23:34:55 +0000 >Subject: [PATCH] Bug 16122: Add unit test > >To test: >1. Apply patch, updatedatabase & schema, restart all Services >2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on. >3. Go to an item record and notice the column 'Local uses' >4. Turn the system preference RecordLocalUseOnReturn Off. >5. Check in an item that is not checkout out. No local use should be recorded for the item. >6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1. >7. Create a statistical patron and check an item out to them. Local use should increment by 1. >8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct. > >To test maintainence script: >1. Without the patch, have RecordLocalUseOnReturn on. >2. Check in some items to record localuse in the stats table. Keep note of those stats. >3. Apply the patches, updatedatabase. >4. Run the maintenance script, perl update_localuse_from_statistics.pl >5. Now check that items.localuse is congruent with what is in the stats table > >Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> >--- > t/db_dependent/Circulation.t | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 8dd246578f2..a05854bef22 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -6252,21 +6252,40 @@ subtest 'Tests for transfer not in transit' => sub { > > subtest 'Tests for RecordLocalUseOnReturn' => sub { > >- plan tests => 2; >+ plan tests => 5; > > t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 0); > my $item = $builder->build_sample_item(); >+ >+ my $item_2 = $builder->build_sample_item( >+ { >+ onloan => undef, >+ } >+ ); >+ > $item->withdrawn(1)->itemlost(1)->store; > my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef ); > is_deeply( > \@return, > [ 0, { NotIssued => $item->barcode, withdrawn => 1 }, undef, {} ], "RecordLocalUSeOnReturn is off, no local use recorded"); > >+ AddReturn( $item_2->barcode, $item_2->homebranch ); >+ $item_2->discard_changes; # refresh >+ is( $item_2->localuse, undef , 'Without RecordLocalUseOnReturn no localuse is recorded.'); >+ > t::lib::Mocks::mock_preference('RecordLocalUseOnReturn', 1); > my @return2 = AddReturn( $item->barcode, $item->homebranch, 0, undef ); > is_deeply( > \@return2, > [ 0, { NotIssued => $item->barcode, withdrawn => 1, LocalUse => 1 }, undef, {} ], "Local use is recorded"); >+ >+ AddReturn( $item_2->barcode, $item_2->homebranch ); >+ $item_2->discard_changes; # refresh >+ is( $item_2->localuse, 1 , 'With RecordLocalUseOnReturn localuse is recorded.'); >+ >+ AddReturn( $item_2->barcode, $item_2->homebranch ); >+ $item_2->discard_changes; # refresh >+ is( $item_2->localuse, 2 , 'With RecordLocalUseOnReturn localuse is recorded.'); > }; > > subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub { >-- >2.30.2
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 16122
:
149281
|
149282
|
149283
|
149284
|
150231
|
150232
|
150233
|
150234
|
150235
|
150236
|
150623
|
150693
|
153193
|
153196
|
153197
|
153198
|
153199
|
153200
|
158466
|
158467
|
158468
|
158469
|
158470
|
158471
|
161001
|
161002
|
161003
|
161004
|
161005
|
161006
|
161144
|
161145
|
161146
|
161147
|
161148
|
161149
|
161150
|
161151
|
161153
|
161154
|
161155
|
161156
|
161157
|
161158
|
161159
|
161160
|
163072
|
163073
|
163074
|
163075
|
163076
|
163077
|
163243
|
163244
|
163245
|
163246
|
163247
|
163248
|
163296
|
163297
|
163298
|
163299
|
163300
|
163301
|
163302
|
163303
|
165313
|
165314
|
165315
|
165316
|
165317
|
165318
|
165319
|
165320