Bugzilla – Attachment 98341 Details for
Bug 18936
Move issuingrules into circulation_rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18936: (follow-up) Fix checkouts endpoint and its tests
Bug-18936-follow-up-Fix-checkouts-endpoint-and-its.patch (text/plain), 2.87 KB, created by
Jonathan Druart
on 2020-02-03 16:09:30 UTC
(
hide
)
Description:
Bug 18936: (follow-up) Fix checkouts endpoint and its tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-03 16:09:30 UTC
Size:
2.87 KB
patch
obsolete
>From df4d06a89c29ce9f52978272044b5d71acb6cd6e Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Wed, 29 Jan 2020 14:06:00 +0000 >Subject: [PATCH] Bug 18936: (follow-up) Fix checkouts endpoint and its tests >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >- Fixes a bug caused by the refactoring in >Koha/REST/V1/Checkouts.pm (run the tests without this patch and you >will see the tests fails because 'rule_name' parameter was >forgotten). > >- Changes the tests to use the new Koha::CirculationRule objects > instead of directly using issuingrules DB table > >Signed-off-by: Minna Kivinen <minna.kivinen@hamk.fi> > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > Koha/REST/V1/Checkouts.pm | 3 ++- > t/db_dependent/api/v1/checkouts.t | 18 ++++++++++++------ > 2 files changed, 14 insertions(+), 7 deletions(-) > >diff --git a/Koha/REST/V1/Checkouts.pm b/Koha/REST/V1/Checkouts.pm >index 7fc6913f1e..c3ae141e67 100644 >--- a/Koha/REST/V1/Checkouts.pm >+++ b/Koha/REST/V1/Checkouts.pm >@@ -213,13 +213,14 @@ sub allows_renewal { > categorycode => $checkout->patron->categorycode, > itemtype => $checkout->item->effective_itemtype, > branchcode => $checkout->branchcode, >+ rule_name => 'renewalsallowed', > } > ); > return $c->render( > status => 200, > openapi => { > allows_renewal => $renewable, >- max_renewals => $rule->renewalsallowed, >+ max_renewals => $rule->rule_value, > current_renewals => $checkout->renewals, > error => $error > } >diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t >index 3a5c5deab9..79752b441c 100644 >--- a/t/db_dependent/api/v1/checkouts.t >+++ b/t/db_dependent/api/v1/checkouts.t >@@ -71,11 +71,18 @@ $t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$notexisting_patron > ->status_is(200) > ->json_is([]); > >-$dbh->do('DELETE FROM issuingrules'); >-$dbh->do(q{ >- INSERT INTO issuingrules (categorycode, branchcode, itemtype, renewalperiod, renewalsallowed, issuelength) >- VALUES (?, ?, ?, ?, ?, ?) >-}, {}, '*', '*', '*', 7, 1, 5); >+Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ itemtype => undef, >+ branchcode => undef, >+ rules => { >+ renewalperiod => 7, >+ renewalsallowed => 1, >+ issuelength => 5, >+ } >+ } >+); > > my $item1 = $builder->build_sample_item; > my $item2 = $builder->build_sample_item; >@@ -173,7 +180,6 @@ $t->get_ok( "//$userid:$password@/api/v1/checkouts/" . $issue2->issue_id) > ->status_is(200) > ->json_is('/due_date' => output_pref( { dateformat => "rfc3339", dt => $date_due2 }) ); > >- > my $expected_datedue = $date_due > ->set_time_zone('local') > ->add(days => 7) >-- >2.11.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 18936
:
65247
|
65248
|
65249
|
67629
|
67758
|
68236
|
71034
|
71035
|
71036
|
71037
|
71038
|
71039
|
71040
|
71041
|
72230
|
72231
|
72232
|
72233
|
72234
|
72235
|
72236
|
72237
|
72238
|
91953
|
91954
|
91955
|
91956
|
91957
|
91958
|
91959
|
91960
|
91961
|
91962
|
91963
|
91964
|
91965
|
91966
|
91967
|
91968
|
91969
|
91970
|
91971
|
91972
|
91973
|
91974
|
91975
|
94179
|
94180
|
94181
|
94182
|
94183
|
94184
|
94185
|
94186
|
94187
|
94188
|
94189
|
94190
|
94191
|
94192
|
94193
|
94194
|
94195
|
94196
|
94197
|
94198
|
94199
|
94200
|
98299
|
98300
|
98301
|
98302
|
98303
|
98304
|
98305
|
98306
|
98307
|
98308
|
98309
|
98310
|
98311
|
98312
|
98313
|
98314
|
98315
|
98316
|
98317
|
98318
|
98319
|
98320
|
98321
|
98322
|
98323
|
98324
|
98325
|
98326
|
98327
|
98328
|
98329
|
98330
|
98331
|
98332
|
98333
|
98334
|
98335
|
98336
|
98337
|
98338
|
98339
|
98340
| 98341 |
98342
|
98343
|
98344
|
98345
|
98346
|
98347
|
98407
|
98408