Bugzilla – Attachment 98159 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.56 KB, created by
Joonas Kylmälä
on 2020-01-30 13:53:33 UTC
(
hide
)
Description:
Bug 24543: Fix wrong test in api/v1/checkouts.t
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2020-01-30 13:53:33 UTC
Size:
2.56 KB
patch
obsolete
>From f2103672a39bf70906c631bf020b0979c3089669 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 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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 > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > 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.17.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 24543
:
98155
|
98158
|
98159
|
98163