Bugzilla – Attachment 87109 Details for
Bug 13895
Add routes for checkouts retrieval and renewal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13895: Remove create_item and create_biblio subs from test
Bug-13895-Remove-createitem-and-createbiblio-subs-.patch (text/plain), 3.63 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-03-27 17:27:33 UTC
(
hide
)
Description:
Bug 13895: Remove create_item and create_biblio subs from test
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-03-27 17:27:33 UTC
Size:
3.63 KB
patch
obsolete
>From 06d7aa4e1d78dd92d4fa5cdd1c17394dfb8a4f41 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Wed, 20 Feb 2019 21:42:36 +0000 >Subject: [PATCH] Bug 13895: Remove create_item and create_biblio subs from > test > >Test plan: >prove t/db_dependent/api/v1/checkouts.t >--- > t/db_dependent/api/v1/checkouts.t | 43 ++++++------------------------- > 1 file changed, 8 insertions(+), 35 deletions(-) > >diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t >index d32cb5595f..c9b988b2dc 100644 >--- a/t/db_dependent/api/v1/checkouts.t >+++ b/t/db_dependent/api/v1/checkouts.t >@@ -27,13 +27,10 @@ use DateTime; > use MARC::Record; > > use C4::Context; >-use C4::Biblio; > use C4::Circulation; >-use C4::Items; > > use Koha::Database; > use Koha::DateUtils; >-use Koha::Patron; > > my $schema = Koha::Database->schema; > my $builder = t::lib::TestBuilder->new; >@@ -91,10 +88,10 @@ $t->request_ok($tx) > ->status_is(200) > ->json_is([]); > >-my $biblionumber = create_biblio('RESTful Web APIs'); >-my $itemnumber1 = create_item($biblionumber, 'TEST000001'); >-my $itemnumber2 = create_item($biblionumber, 'TEST000002'); >-my $itemnumber3 = create_item($biblionumber, 'TEST000003'); >+my $biblionumber = $builder->build_sample_biblio({ title => 'RESTful Web APIs'})->biblionumber; >+my $itemnumber1 = $builder->build_sample_item({ biblionumber => $biblionumber, barcode => 'TEST000001'})->itemnumber; >+my $itemnumber2 = $builder->build_sample_item({ biblionumber => $biblionumber, barcode => 'TEST000002'})->itemnumber; >+my $itemnumber3 = $builder->build_sample_item({ biblionumber => $biblionumber, barcode => 'TEST000003'})->itemnumber; > > my $date_due = DateTime->now->add(weeks => 2); > my $issue1 = C4::Circulation::AddIssue($patron, 'TEST000001', $date_due); >@@ -122,15 +119,15 @@ $t->request_ok($tx) > ->status_is(403) > ->json_is({ error => "Authorization failure. Missing required permission(s).", > required_permissions => { circulate => "circulate_remaining_permissions" } >- }); >+ }); > > $tx = $t->ua->build_tx(GET => "/api/v1/checkouts?patron_id=".$loggedinuser->{borrowernumber}); > $tx->req->cookies({name => 'CGISESSID', value => $patron_session->id}); > $t->request_ok($tx) > ->status_is(403) > ->json_is({ error => "Authorization failure. Missing required permission(s).", >- required_permissions => { circulate => "circulate_remaining_permissions" } >- }); >+ required_permissions => { circulate => "circulate_remaining_permissions" } >+ }); > > $tx = $t->ua->build_tx(GET => "/api/v1/checkouts?patron_id=$borrowernumber"); > $tx->req->cookies({name => 'CGISESSID', value => $session->id}); >@@ -185,7 +182,7 @@ $t->request_ok($tx) > ->status_is(403) > ->json_is({ error => "Authorization failure. Missing required permission(s).", > required_permissions => { circulate => "circulate_remaining_permissions" } >- }); >+ }); > > $tx = $t->ua->build_tx(PUT => "/api/v1/checkouts/" . $issue2->issue_id); > $tx->req->cookies({name => 'CGISESSID', value => $session->id}); >@@ -199,27 +196,3 @@ $t->request_ok($tx) > ->status_is(403) > ->json_is({ error => 'Renewal not authorized (too_many)' }); > >-sub create_biblio { >- my ($title) = @_; >- >- my $record = new MARC::Record; >- $record->append_fields( >- new MARC::Field('200', ' ', ' ', a => $title), >- ); >- >- my ($biblionumber) = C4::Biblio::AddBiblio($record, ''); >- >- return $biblionumber; >-} >- >-sub create_item { >- my ($biblionumber, $barcode) = @_; >- >- my $item = { >- barcode => $barcode, >- }; >- >- my $itemnumber = C4::Items::AddItem($item, $biblionumber); >- >- return $itemnumber; >-} >-- >2.21.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 13895
:
37146
|
40104
|
40143
|
40588
|
41163
|
41548
|
45817
|
50021
|
51303
|
53816
|
53817
|
53878
|
53889
|
53890
|
53891
|
53901
|
53924
|
54196
|
54685
|
54951
|
56167
|
56506
|
58387
|
69123
|
84765
|
85458
|
85459
|
85460
|
85461
|
85462
|
85463
|
85464
|
85676
|
86120
|
86576
|
86579
|
86580
|
87105
|
87106
|
87107
|
87108
| 87109 |
87110
|
87111
|
87112
|
87113
|
87114
|
87115
|
87200