From deaeed7903d78965cab25099dcb9831547e8ad9f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 27 Jan 2017 10:14:46 +0100 Subject: [PATCH] Bug 17782: Fix tests Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 185256deba961c2595ce934afbb910cf3ad952e0) Signed-off-by: Katrin Fischer --- t/db_dependent/Koha/Patrons.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index 175c87131b..c9d9adde29 100644 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -268,7 +268,7 @@ subtest 'renew_account' => sub { }; subtest "move_to_deleted" => sub { - plan tests => 3; + plan tests => 5; my $originally_updated_on = '2016-01-01 12:12:12'; my $patron = $builder->build( { source => 'Borrower',value => { updated_on => $originally_updated_on } } ); my $retrieved_patron = Koha::Patrons->find( $patron->{borrowernumber} ); @@ -277,7 +277,9 @@ subtest "move_to_deleted" => sub { my $deleted_patron = $schema->resultset('Deletedborrower') ->search( { borrowernumber => $patron->{borrowernumber} }, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' } ) ->next; - isnt( $deleted_patron->{updated_on}, $retrieved_patron->{updated_on}, 'Koha::Patron->move_to_deleted should have correctly updated the updated_on column'); + ok( $retrieved_patron->updated_on, 'updated_on should be set for borrowers table' ); + ok( $deleted_patron->{updated_on}, 'updated_on should be set for deleted_borrowers table' ); + isnt( $deleted_patron->{updated_on}, $retrieved_patron->updated_on, 'Koha::Patron->move_to_deleted should have correctly updated the updated_on column'); $deleted_patron->{updated_on} = $originally_updated_on; #reset for simplicity in comparing all other fields is_deeply( $deleted_patron, $patron, 'Koha::Patron->move_to_deleted should have correctly moved the patron to the deleted table' ); $retrieved_patron->delete( $patron->{borrowernumber} ); # Cleanup -- 2.39.5