Bugzilla – Attachment 42028 Details for
Bug 14297
Holds Queue building ignoring holds where pickup & home branch don't match and item is not from least cost branch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14297 - Unit Tests
Bug-14297---Unit-Tests.patch (text/plain), 3.66 KB, created by
Kyle M Hall (khall)
on 2015-08-27 13:39:04 UTC
(
hide
)
Description:
Bug 14297 - Unit Tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-08-27 13:39:04 UTC
Size:
3.66 KB
patch
obsolete
>From e30b2d97610c60e75982ebcabc8bf0dfb533fe3f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 27 Aug 2015 09:16:43 -0400 >Subject: [PATCH] Bug 14297 - Unit Tests > >--- > t/db_dependent/HoldsQueue.t | 61 ++++++++++++++++++++++++++++++++++++++++++- > 1 files changed, 60 insertions(+), 1 deletions(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index 6d997d6..97018a7 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -12,7 +12,7 @@ use C4::Context; > > use Data::Dumper; > >-use Test::More tests => 21; >+use Test::More tests => 22; > > > use C4::Branch; >@@ -297,6 +297,65 @@ $holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice > ok( @$holds_queue == 3, "Holds queue filling correct number for holds for default holds policy 'from any library'" ); > #warn "HOLDS QUEUE: " . Data::Dumper::Dumper( $holds_queue ); > >+# Bug 14297 >+$borrowernumber = AddMember(%data); >+$borrower = GetMember( borrowernumber => $borrowernumber ); >+$borrower_branchcode = $borrower->{branchcode}; >+$itemtype = $item_types[0]->{itemtype}; >+my $library_A = 'CPL'; >+my $library_B = 'FFL'; >+my $library_C = 'MPL'; # Same as our borrower's home library >+$dbh->do("DELETE FROM reserves"); >+$dbh->do("DELETE FROM issues"); >+$dbh->do("DELETE FROM items"); >+$dbh->do("DELETE FROM biblio"); >+$dbh->do("DELETE FROM biblioitems"); >+$dbh->do("DELETE FROM transport_cost"); >+$dbh->do("DELETE FROM tmp_holdsqueue"); >+$dbh->do("DELETE FROM hold_fill_targets"); >+$dbh->do("DELETE FROM default_branch_circ_rules"); >+$dbh->do("DELETE FROM default_branch_item_rules"); >+$dbh->do("DELETE FROM default_circ_rules"); >+$dbh->do("DELETE FROM branch_item_rules"); >+ >+$dbh->do(" >+ INSERT INTO biblio (frameworkcode, author, title, datecreated) VALUES ('', 'Koha test', '$TITLE', '2011-02-01') >+"); >+ >+$biblionumber = $dbh->selectrow_array("SELECT biblionumber FROM biblio WHERE title = '$TITLE'") >+ or BAIL_OUT("Cannot find newly created biblio record"); >+ >+$dbh->do("INSERT INTO biblioitems (biblionumber, marcxml, itemtype) VALUES ($biblionumber, '', '$itemtype')"); >+ >+$biblioitemnumber = >+ $dbh->selectrow_array("SELECT biblioitemnumber FROM biblioitems WHERE biblionumber = $biblionumber") >+ or BAIL_OUT("Cannot find newly created biblioitems record"); >+ >+$dbh->do(" >+ INSERT INTO items (biblionumber, biblioitemnumber, homebranch, holdingbranch, notforloan, damaged, itemlost, withdrawn, onloan, itype) >+ VALUES ($biblionumber, $biblioitemnumber, '$library_A', '$library_A', 0, 0, 0, 0, NULL, '$itemtype') >+"); >+ >+$dbh->do(" >+ INSERT INTO items (biblionumber, biblioitemnumber, homebranch, holdingbranch, notforloan, damaged, itemlost, withdrawn, onloan, itype) >+ VALUES ($biblionumber, $biblioitemnumber, '$library_B', '$library_B', 0, 0, 0, 0, NULL, '$itemtype') >+"); >+ >+$dbh->do(" >+ INSERT INTO branch_item_rules ( branchcode, itemtype, holdallowed, returnbranch ) VALUES >+ ( '$library_A', '$itemtype', 2, 'homebranch' ), ( '$library_B', '$itemtype', 1, 'homebranch' ); >+"); >+ >+$dbh->do( "UPDATE systempreferences SET value = ? WHERE variable = 'StaticHoldsQueueWeight'", >+ undef, join( ',', $library_B, $library_A, $library_C ) ); >+$dbh->do( "UPDATE systempreferences SET value = 0 WHERE variable = 'RandomizeHoldsQueueWeight'" ); >+ >+my $reserve_id = AddReserve ( $library_C, $borrowernumber, $biblionumber, '', 1 ); >+C4::HoldsQueue::CreateQueue(); >+$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); >+is( @$holds_queue, 1, "Bug 14297 - Holds Queue building ignoring holds where pickup & home branch don't match and item is not from least cost branch" ); >+# End Bug 14297 >+ > # Cleanup > $dbh->rollback; > >-- >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 14297
:
39668
|
41110
|
42026
|
42027
|
42028
|
42029
|
42341
|
42348
|
42349
|
42350