Bugzilla – Attachment 159883 Details for
Bug 35469
Cannot create bookings without circulation permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35469: Unit test
Bug-35469-Unit-test.patch (text/plain), 1.75 KB, created by
Martin Renvoize (ashimema)
on 2023-12-15 11:46:56 UTC
(
hide
)
Description:
Bug 35469: Unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-12-15 11:46:56 UTC
Size:
1.75 KB
patch
obsolete
>From 706ef24262758116d6a9d30b15e0a4b97c1c6ba5 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 15 Dec 2023 11:46:08 +0000 >Subject: [PATCH] Bug 35469: Unit test > >This patch adds a unit test to check that manage_bookings allows >fetching of checkouts. >--- > t/db_dependent/api/v1/checkouts.t | 25 ++++++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t >index 8c16f1f88e0..4b3437cd7d1 100755 >--- a/t/db_dependent/api/v1/checkouts.t >+++ b/t/db_dependent/api/v1/checkouts.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 105; >+use Test::More tests => 108; > use Test::MockModule; > use Test::Mojo; > use t::lib::Mocks; >@@ -67,6 +67,29 @@ $t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$patron_id" ) > > my $notexisting_patron_id = $patron_id + 1; > $t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$notexisting_patron_id" ) >+ ->status_is(200, 'manage_bookings allows checkouts access') >+ ->json_is([]); >+ >+my $bookings_librarian = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { flags => 0 } # no additional permissions >+ } >+); >+$builder->build( >+ { >+ source => 'UserPermission', >+ value => { >+ borrowernumber => $bookings_librarian->borrowernumber, >+ module_bit => 1, >+ code => 'manage_bookings', >+ }, >+ } >+); >+$bookings_librarian->set_password( { password => $password, skip_validation => 1 } ); >+my $bookings_userid = $bookings_librarian->userid; >+ >+$t->get_ok( "//$bookings_userid:$password@/api/v1/checkouts?patron_id=$patron_id" ) > ->status_is(200) > ->json_is([]); > >-- >2.43.0
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 35469
:
159882
|
159883
|
159996
|
159997
|
160005
|
160006
|
160007
|
161490
|
161491
|
161492
|
161639
|
161640
|
161641
|
161642
|
162644
|
162645