Bugzilla – Attachment 19159 Details for
Bug 10495
t/db_dependent/HoldsQueue.t can fail unnecessarily
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bug 10495: set precondition for HoldsQueue test
bug-10495-set-precondition-for-HoldsQueue-test.patch (text/plain), 3.07 KB, created by
Galen Charlton
on 2013-06-19 17:35:55 UTC
(
hide
)
Description:
bug 10495: set precondition for HoldsQueue test
Filename:
MIME Type:
Creator:
Galen Charlton
Created:
2013-06-19 17:35:55 UTC
Size:
3.07 KB
patch
obsolete
>From f7e6b602cd2f4d83a245d860de5c8019f3e03eae Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Wed, 19 Jun 2013 10:30:58 -0700 >Subject: [PATCH] bug 10495: set precondition for HoldsQueue test > >t/db_dependent/HoldsQueue.t assumed, but did not check, >that the AutomaticItemReturns system preference was off >at the beginning of the test un. This patch makes sure >that that assumption is met. > >To test: > >[1] Make sure that at least one item is on loan (this is > another assumption that the test case makes, one > that should be corrected with the work proposed > for bug 10336. >[2] Turn the AutomaticItemReturn system preference on. >[3] Run the test: > >prove -v t/db_dependent/HoldsQueue.t > >[4] Tests 4 and 6 should fail. >[5] Apply the patch. >[6] Run the test case again; this time, all tests should pass. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >--- > t/db_dependent/HoldsQueue.t | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index 7fb459a..a20d309 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -101,6 +101,7 @@ my $test_sth = $dbh->prepare("SELECT * FROM hold_fill_targets > WHERE borrowernumber = $borrowernumber"); > > # We have a book available homed in borrower branch, no point fiddling with AutomaticItemReturn >+C4::Context->set_preference('AutomaticItemReturn', 0); > test_queue ('take from homebranch', 0, $borrower_branchcode, $borrower_branchcode); > test_queue ('take from homebranch', 1, $borrower_branchcode, $borrower_branchcode); > >@@ -109,7 +110,7 @@ $dbh->do("DELETE FROM hold_fill_targets"); > $dbh->do("DELETE FROM issues WHERE itemnumber IN (SELECT itemnumber FROM items WHERE homebranch = '$borrower_branchcode' AND holdingbranch = '$borrower_branchcode')"); > $dbh->do("DELETE FROM items WHERE homebranch = '$borrower_branchcode' AND holdingbranch = '$borrower_branchcode'"); > # test_queue will flush >-$dbh->do("UPDATE systempreferences SET value = 1 WHERE variable = 'AutomaticItemReturn'"); >+C4::Context->set_preference('AutomaticItemReturn', 1); > # Not sure how to make this test more difficult - holding branch does not matter > test_queue ('take from holdingbranch AutomaticItemReturn on', 0, $borrower_branchcode, undef); > test_queue ('take from holdingbranch AutomaticItemReturn on', 1, $borrower_branchcode, $least_cost_branch_code); >@@ -118,7 +119,7 @@ $dbh->do("DELETE FROM tmp_holdsqueue"); > $dbh->do("DELETE FROM hold_fill_targets"); > $dbh->do("DELETE FROM issues WHERE itemnumber IN (SELECT itemnumber FROM items WHERE homebranch = '$borrower_branchcode')"); > $dbh->do("DELETE FROM items WHERE homebranch = '$borrower_branchcode'"); >-$dbh->do("UPDATE systempreferences SET value = 0 WHERE variable = 'AutomaticItemReturn'"); >+C4::Context->set_preference('AutomaticItemReturn', 0); > # We have a book available held in borrower branch > test_queue ('take from holdingbranch', 0, $borrower_branchcode, $borrower_branchcode); > test_queue ('take from holdingbranch', 1, $borrower_branchcode, $borrower_branchcode); >-- >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 10495
:
19159
|
19173
|
19257