From b58fce93270e5691a0f515a205b7072cc70f2787 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Feb 2018 16:32:26 -0300 Subject: [PATCH] Bug 20144: [sql_modes] Do not store 0000-00-00 This patch needs to be linked with bug 20145. Fix for: Incorrect date value: '0000-00-00' for column 'dateexpiry' We cannot longer store 0000-00-00, but no need to. The tests must be kept for now as long as bug 20145 has a solution Signed-off-by: Josef Moravec Signed-off-by: Julian Maurice --- t/db_dependent/Koha/Patrons.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index d793996793..4722807e8f 100644 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -190,8 +190,8 @@ subtest 'is_expired' => sub { $patron = Koha::Patrons->find( $patron->{borrowernumber} ); $patron->dateexpiry( undef )->store->discard_changes; is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is not set'); - $patron->dateexpiry( '0000-00-00' )->store->discard_changes; - is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is not 0000-00-00'); + $patron->dateexpiry( '0000-00-00' ); + is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is 0000-00-00'); $patron->dateexpiry( dt_from_string )->store->discard_changes; is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is today'); $patron->dateexpiry( dt_from_string->add( days => 1 ) )->store->discard_changes; @@ -208,8 +208,8 @@ subtest 'is_going_to_expire' => sub { $patron = Koha::Patrons->find( $patron->{borrowernumber} ); $patron->dateexpiry( undef )->store->discard_changes; is( $patron->is_going_to_expire, 0, 'Patron should not be considered going to expire if dateexpiry is not set'); - $patron->dateexpiry( '0000-00-00' )->store->discard_changes; - is( $patron->is_going_to_expire, 0, 'Patron should not be considered going to expire if dateexpiry is not 0000-00-00'); + $patron->dateexpiry( '0000-00-00' ); + is( $patron->is_going_to_expire, 0, 'Patron should not be considered going to expire if dateexpiry is 0000-00-00'); t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 0); $patron->dateexpiry( dt_from_string )->store->discard_changes; -- 2.14.2