Bugzilla – Attachment 35090 Details for
Bug 5144
Duplicate holds allowed if patron clicks back button after placing hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5144 [1] - Unit test
Bug-5144-1---Unit-test.patch (text/plain), 3.29 KB, created by
Kyle M Hall (khall)
on 2015-01-09 15:24:10 UTC
(
hide
)
Description:
Bug 5144 [1] - Unit test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-01-09 15:24:10 UTC
Size:
3.29 KB
patch
obsolete
>From 01149e419d2704d12f4bbb00f722d6a181ed9a95 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 4 Jun 2014 09:45:49 -0400 >Subject: [PATCH] Bug 5144 [1] - Unit test > >--- > t/db_dependent/Reserves.t | 26 ++++++++++++++++++++++---- > 1 files changed, 22 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 4676a60..7cbad69 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 53; >+use Test::More tests => 54; > > use MARC::Record; > use DateTime::Duration; >@@ -153,6 +153,13 @@ $requesters{'CPL'} = AddMember( > categorycode => 'PT', > surname => 'borrower from CPL', > ); >+for my $i ( 2 .. 5 ) { >+ $requesters{"CPL$i"} = AddMember( >+ branchcode => 'CPL', >+ categorycode => 'PT', >+ surname => 'borrower $i from CPL', >+ ); >+} > $requesters{'FPL'} = AddMember( > branchcode => 'FPL', > categorycode => 'PT', >@@ -389,11 +396,12 @@ ModReserveAffect( $itemnumber, $requesters{'CPL'} , 0); #confirm hold > is(defined $results[3]?1:0, 1, 'GetReservesFromItemnumber returns a future wait (confirmed future hold)'); > # End of tests for bug 9788 > >+$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); > # Tests for CalculatePriority (bug 8918) > my $p = C4::Reserves::CalculatePriority($bibnum2); > is($p, 4, 'CalculatePriority should now return priority 4'); > $resdate=undef; >-AddReserve('CPL', $requesters{'CPL'}, $bibnum2, >+AddReserve('CPL', $requesters{'CPL2'}, $bibnum2, > $constraint, $bibitems, $p, $resdate, $expdate, $notes, > $title, $checkitem, $found); > $p = C4::Reserves::CalculatePriority($bibnum2); >@@ -412,7 +420,7 @@ ModReserveAffect( $itemnumber, $requesters{'CPL'} , 0); > $p = C4::Reserves::CalculatePriority($bibnum); > is($p, 1, 'CalculatePriority should now return priority 1'); > #add another biblio hold, no resdate >-AddReserve('CPL', $requesters{'CPL'}, $bibnum, >+AddReserve('CPL', $requesters{'CPL3'}, $bibnum, > $constraint, $bibitems, $p, $resdate, $expdate, $notes, > $title, $checkitem, $found); > $p = C4::Reserves::CalculatePriority($bibnum); >@@ -421,7 +429,7 @@ is($p, 2, 'CalculatePriority should now return priority 2'); > C4::Context->set_preference('AllowHoldDateInFuture', 1); > $resdate= dt_from_string(); > $resdate->add_duration(DateTime::Duration->new(days => 1)); >-AddReserve('CPL', $requesters{'CPL'}, $bibnum, >+AddReserve('CPL', $requesters{'CPL4'}, $bibnum, > $constraint, $bibitems, $p, output_pref($resdate), $expdate, $notes, > $title, $checkitem, $found); > $p = C4::Reserves::CalculatePriority($bibnum); >@@ -506,6 +514,16 @@ is( C4::Reserves::CanBookBeReserved($borrowernumber, $biblionumber) , 'OK', "Res > ####### EO Bug 13113 <<< > #### > >+AddReserve('CPL', $requesters{'CPL'}, $item_bibnum, >+ $constraint, $bibitems, 1, undef, $expdate, $notes, >+ $title, $checkitem, ''); >+my ($count) = C4::Context->dbh->selectrow_array( >+'SELECT COUNT(*) FROM reserves WHERE biblionumber = ? AND borrowernumber = ?', >+ undef, >+ ( $item_bibnum, $requesters{'CPL'} ) >+); >+ok( $count == 1, 'Duplicate hold not placed (Bug 5144)' ); >+ > $dbh->rollback; > > sub count_hold_print_messages { >-- >1.7.2.5
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 5144
:
28657
|
28658
|
28659
|
34983
|
34984
|
34985
|
34986
|
34987
|
34988
|
35090
|
35091
|
35092
|
35093
|
35451
|
40823
|
40824
|
42530
|
42792
|
42848
|
43118
|
43119
|
43120
|
43121
|
43122
|
43125
|
43126
|
43164
|
43165
|
43166
|
43167