Bugzilla – Attachment 23811 Details for
Bug 11445
it is possible for duplicate hold notifications to be sent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11445: regression test for duplicate hold notifications
Bug-11445-regression-test-for-duplicate-hold-notif.patch (text/plain), 2.43 KB, created by
Galen Charlton
on 2013-12-25 17:48:35 UTC
(
hide
)
Description:
Bug 11445: regression test for duplicate hold notifications
Filename:
MIME Type:
Creator:
Galen Charlton
Created:
2013-12-25 17:48:35 UTC
Size:
2.43 KB
patch
obsolete
>From 83186fd4f9dcab662abb282e3385827ca6210b39 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Wed, 25 Dec 2013 17:38:39 +0000 >Subject: [PATCH] Bug 11445: regression test for duplicate hold notifications > >This patch implements a regression test for verifying that >duplicate hold notifications aren't sent if ModReserveAffect() is >called repeatedly (as might happen if a circ operator accidentally >checks in an item and confirms its hold more than once). > >Note that the test depends on the fact that _koha_notify_reserve() >defaults to sending a HOLD_PRINT letter if the borrower has not >specified an email or SMS hold notification. > >To test: > >[1] Run prove -v t/db_dependent/Reserves.t >[2] The 'patron not notified a second time (bug 11445)' test > should fail. >[3] Apply the main patch and run prove -v t/db_dependent/Reserves.t > again. This time all tests should pass. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >--- > t/db_dependent/Reserves.t | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 6906120..c733cf7 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 18; >+use Test::More tests => 20; > use MARC::Record; > use DateTime::Duration; > >@@ -269,7 +269,15 @@ is(exists $messages->{ResFound}?1:0, 1, 'AddReturn considers future reserve with > # End of tests for bug 9761 (ConfirmFutureHolds) > > # test marking a hold as captured >+my $hold_notice_count = count_hold_print_messages(); > ModReserveAffect($itemnumber, $requesters{'CPL'}, 0); >+my $new_count = count_hold_print_messages(); >+is($new_count, $hold_notice_count + 1, 'patron notified when item set to waiting'); >+ >+# test that duplicate notices aren't generated >+ModReserveAffect($itemnumber, $requesters{'CPL'}, 0); >+$new_count = count_hold_print_messages(); >+is($new_count, $hold_notice_count + 1, 'patron not notified a second time (bug 11445)'); > > is( > DelItemCheck($dbh, $bibnum, $itemnumber), >@@ -281,3 +289,10 @@ my $letter = ReserveSlip('CPL', $requesters{'CPL'}, $bibnum); > ok(defined($letter), 'can successfully generate hold slip (bug 10949)'); > > $dbh->rollback; >+ >+sub count_hold_print_messages { >+ my $message_count = $dbh->selectall_arrayref(q{ >+ SELECT COUNT(*) FROM message_queue WHERE letter_code = 'HOLD_PRINT' >+ }); >+ return $message_count->[0]->[0]; >+} >-- >1.7.10.4
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 11445
:
23811
|
23812
|
23842
|
23843
|
23852
|
23853