Bugzilla – Attachment 117757 Details for
Bug 27863
Cannot select different pickup locations even with AllowHoldsPolicyOverride on request.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27863: Unit tests
Bug-27863-Unit-tests.patch (text/plain), 1.91 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-03-04 17:56:12 UTC
(
hide
)
Description:
Bug 27863: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-03-04 17:56:12 UTC
Size:
1.91 KB
patch
obsolete
>From eac53dfcf5d7529ed98faa752b52c183b0e4b5cd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 4 Mar 2021 14:41:17 -0300 >Subject: [PATCH] Bug 27863: Unit tests > >--- > t/db_dependent/api/v1/holds.t | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 41cf559ca99..cf03c6450ef 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -687,7 +687,7 @@ subtest 'add() tests (maxreserves behaviour)' => sub { > > subtest 'pickup_locations() tests' => sub { > >- plan tests => 9; >+ plan tests => 10; > > $schema->storage->txn_begin; > >@@ -803,6 +803,32 @@ subtest 'pickup_locations() tests' => sub { > . '/pickup_locations?q={"marc_org_code": { "-like": "A%" }}' ) > ->json_is( [ $library_1->to_api ] ); > >+ subtest 'x-koha-override + AllowHoldPolicyOverride tests' => sub { >+ >+ plan tests => 6; >+ >+ my $allowholdpolicyoverride = C4::Context->preference('AllowHoldPolicyOverride'); >+ >+ t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', 1 ); >+ >+ my $pickup_locations = Koha::Libraries->search({ pickup_location => 1 }); >+ >+ $t->get_ok( "//$userid:$password@/api/v1/holds/" >+ . $hold_1->id >+ . "/pickup_locations" >+ => { 'x-koha-override' => 'any' } ) >+ ->json_is( $pickup_locations->to_api ); >+ >+ t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', 0 ); >+ >+ $t->get_ok( "//$userid:$password@/api/v1/holds/" >+ . $hold_1->id >+ . "/pickup_locations" >+ => { 'x-koha-override' => 'any' } ) >+ ->json_is( $hold_1->biblio->pickup_locations({ patron => $patron })->to_api ); >+ >+ t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', $allowholdpolicyoverride ); >+ }; > > $schema->storage->txn_rollback; > }; >-- >2.30.1
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 27863
:
117757
|
117758
|
117874
|
117937
|
117958