Bugzilla – Attachment 98155 Details for
Bug 24543
Wrong test in api/v1/checkouts.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24543: Fix wrong test in api/v1/checkouts.t
Bug-24543-Fix-wrong-test-in-apiv1checkoutst.patch (text/plain), 2.41 KB, created by
Jonathan Druart
on 2020-01-30 10:53:17 UTC
(
hide
)
Description:
Bug 24543: Fix wrong test in api/v1/checkouts.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-30 10:53:17 UTC
Size:
2.41 KB
patch
obsolete
>From fecd051187d3de1311c058b9b6e4eea1c90b9b66 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 30 Jan 2020 11:51:25 +0100 >Subject: [PATCH] Bug 24543: Fix wrong test in api/v1/checkouts.t > >In t/db_dependent/api/v1/checkouts.t we define a circulation rule with renewalperiod=7. >But then the expected due date is today+14 days. >However, at the beginning of the script, the due_date of the issue is today+14 days. > >That highlight that the renewal period is not taken into account. > >The circulation rule is created with renewalperiod and renewalsallowed, >however GetLoanLength check the existence of issuelength to return the rule. >GetLoanLength finally return the default rule, with renewalperiod=0 > >Note that this has been found working on bug 18936, code will be cleaned on that patchset. > >Test plan: > % prove t/db_dependent/api/v1/checkouts.t >must return green before and after this patch >--- > t/db_dependent/api/v1/checkouts.t | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t >index 5a3447412e..3a5c5deab9 100644 >--- a/t/db_dependent/api/v1/checkouts.t >+++ b/t/db_dependent/api/v1/checkouts.t >@@ -71,6 +71,12 @@ $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); >+ > my $item1 = $builder->build_sample_item; > my $item2 = $builder->build_sample_item; > my $item3 = $builder->build_sample_item; >@@ -168,15 +174,9 @@ $t->get_ok( "//$userid:$password@/api/v1/checkouts/" . $issue2->issue_id) > ->json_is('/due_date' => output_pref( { dateformat => "rfc3339", dt => $date_due2 }) ); > > >-$dbh->do('DELETE FROM issuingrules'); >-$dbh->do(q{ >- INSERT INTO issuingrules (categorycode, branchcode, itemtype, renewalperiod, renewalsallowed) >- VALUES (?, ?, ?, ?, ?) >-}, {}, '*', '*', '*', 7, 1); >- >-my $expected_datedue = DateTime->now >+my $expected_datedue = $date_due > ->set_time_zone('local') >- ->add(days => 14) >+ ->add(days => 7) > ->set(hour => 23, minute => 59, second => 0); > $t->post_ok ( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id . "/renewal" ) > ->status_is(201) >-- >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 24543
:
98155
|
98158
|
98159
|
98163