Bugzilla – Attachment 120289 Details for
Bug 27797
Make POST /holds use the stashed koha.overrides
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27797: (QA follow-up) Make tests more robust
Bug-27797-QA-follow-up-Make-tests-more-robust.patch (text/plain), 1.49 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-04-28 18:59:31 UTC
(
hide
)
Description:
Bug 27797: (QA follow-up) Make tests more robust
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-04-28 18:59:31 UTC
Size:
1.49 KB
patch
obsolete
>From c3053203ded3284056419c03061304ebf1487142 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 8 Mar 2021 11:43:04 -0300 >Subject: [PATCH] Bug 27797: (QA follow-up) Make tests more robust > >This patch makes the tests mock things so the complex holds scenarios >where existing data could interfere, don't get in the middle with what >we need to test. > >To test: >1. Apply this patch >2. Run: > $ kshell > k$ prove t/db_dependent/api/v1/holds.t >=> SUCCESS: Nothing broke > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/holds.t | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 774508d4195..1a80452d882 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -1036,6 +1036,21 @@ subtest 'add() tests' => sub { > return Koha::Libraries->search( { branchcode => [ $library_2->branchcode, $library_3->branchcode ] } ); > }); > >+ my $can_be_reserved = 'OK'; >+ my $mock_reserves = Test::MockModule->new('C4::Reserves'); >+ $mock_reserves->mock( 'CanItemBeReserved', sub >+ { >+ return { status => $can_be_reserved } >+ } >+ >+ ); >+ $mock_reserves->mock( 'CanBookBeReserved', sub >+ { >+ return { status => $can_be_reserved } >+ } >+ >+ ); >+ > my $biblio = $builder->build_sample_biblio; > my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); > >-- >2.31.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 27797
:
117498
|
117499
|
117540
|
117541
|
117761
|
117762
|
117763
|
117920
|
117929
|
117930
|
120285
|
120286
|
120287
|
120288
| 120289 |
120290