Bugzilla – Attachment 120338 Details for
Bug 28254
Make it possible to override rules in PUT /holds/:hold_id/pickup_location
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28254: Unit tests
Bug-28254-Unit-tests.patch (text/plain), 1.75 KB, created by
Martin Renvoize
on 2021-04-30 13:36:41 UTC
(
hide
)
Description:
Bug 28254: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2021-04-30 13:36:41 UTC
Size:
1.75 KB
patch
obsolete
>From 6870f549edb8654ecc3487edfd06870cfd56640e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 28 Apr 2021 14:55:52 -0300 >Subject: [PATCH] Bug 28254: Unit tests > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/api/v1/holds.t | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 44a12447a0..beaaee5110 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -1136,7 +1136,7 @@ subtest 'add() tests' => sub { > > subtest 'PUT /holds/{hold_id}/pickup_location tests' => sub { > >- plan tests => 16; >+ plan tests => 20; > > $schema->storage->txn_begin; > >@@ -1240,6 +1240,21 @@ subtest 'PUT /holds/{hold_id}/pickup_location tests' => sub { > > is( $hold->discard_changes->branchcode->branchcode, $library_1->branchcode, 'pickup library unchanged' ); > >+ t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', 1 ); >+ >+ # Attempt to use an invalid pickup locations with override succeeds >+ $t->put_ok( "//$userid:$password@/api/v1/holds/" >+ . $hold->id >+ . "/pickup_location" >+ => { 'x-koha-override' => 'any' } >+ => json => { pickup_library_id => $library_2->branchcode } ) >+ ->status_is(200) >+ ->json_is({ pickup_library_id => $library_2->branchcode }); >+ >+ is( $hold->discard_changes->branchcode->branchcode, $library_2->branchcode, 'pickup library changed' ); >+ >+ t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', 0 ); >+ > $libraries_query = { > branchcode => { > '-in' => [ $library_1->branchcode, $library_2->branchcode ] >-- >2.20.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 28254
:
120281
|
120282
|
120283
|
120305
|
120306
|
120307
|
120337
| 120338 |
120339
|
120340
|
120457
|
120458