Bugzilla – Attachment 68423 Details for
Bug 19517
dateexpiry.t is failing randomly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19517: Prevent dateexpiry.t to fail randomly
Bug-19517-Prevent-dateexpiryt-to-fail-randomly.patch (text/plain), 2.97 KB, created by
Jonathan Druart
on 2017-10-23 16:22:24 UTC
(
hide
)
Description:
Bug 19517: Prevent dateexpiry.t to fail randomly
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-10-23 16:22:24 UTC
Size:
2.97 KB
patch
obsolete
>From 56a686204546c91a1a23afb10932b62774bf0eb0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 23 Oct 2017 13:19:42 -0300 >Subject: [PATCH] Bug 19517: Prevent dateexpiry.t to fail randomly > >If categorycode is 'X', the test will fail > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Circulation/dateexpiry.t | 24 ++++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Circulation/dateexpiry.t b/t/db_dependent/Circulation/dateexpiry.t >index dbb7e0bda6..c8b5f49c85 100644 >--- a/t/db_dependent/Circulation/dateexpiry.t >+++ b/t/db_dependent/Circulation/dateexpiry.t >@@ -34,6 +34,8 @@ my $builder = t::lib::TestBuilder->new(); > > $ENV{ DEBUG } = 0; > >+my $patron_category = $builder->build({ source => 'Category', value => { categorycode => 'NOT_X', category_type => 'P', enrolmentfee => 0 } }); >+ > subtest 'Tests for CanBookBeIssued related to dateexpiry' => sub { > plan tests => 4; > can_book_be_issued(); >@@ -47,7 +49,10 @@ sub can_book_be_issued { > my $item = $builder->build( { source => 'Item' } ); > my $patron = $builder->build( > { source => 'Borrower', >- value => { dateexpiry => '9999-12-31' } >+ value => { >+ dateexpiry => '9999-12-31', >+ categorycode => $patron_category->{categorycode}, >+ } > } > ); > $patron->{flags} = C4::Members::patronflags( $patron ); >@@ -60,7 +65,10 @@ sub can_book_be_issued { > $item = $builder->build( { source => 'Item' } ); > $patron = $builder->build( > { source => 'Borrower', >- value => { dateexpiry => '0000-00-00' } >+ value => { >+ dateexpiry => '0000-00-00', >+ categorycode => $patron_category->{categorycode}, >+ } > } > ); > $patron->{flags} = C4::Members::patronflags( $patron ); >@@ -71,7 +79,10 @@ sub can_book_be_issued { > $item = $builder->build( { source => 'Item' } ); > $patron = $builder->build( > { source => 'Borrower', >- value => { dateexpiry => output_pref( { dt => $tomorrow, dateonly => 1, dateformat => 'sql' } ) }, >+ value => { >+ dateexpiry => output_pref( { dt => $tomorrow, dateonly => 1, dateformat => 'sql' } ), >+ categorycode => $patron_category->{categorycode}, >+ }, > } > ); > $patron->{flags} = C4::Members::patronflags( $patron ); >@@ -85,7 +96,12 @@ sub calc_date_due { > > # this triggers the compare between expiry and due date > >- my $patron = $builder->build( { source => 'Borrower' } ); >+ my $patron = $builder->build({ >+ source => 'Borrower', >+ value => { >+ categorycode => $patron_category->{categorycode}, >+ } >+ }); > my $item = $builder->build( { source => 'Item' } ); > my $branch = $builder->build( { source => 'Branch' } ); > my $today = dt_from_string(); >-- >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 19517
: 68423