From 3b24db521c98725dcb54cb1bcb953f032f24ad98 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 3 Nov 2021 13:41:44 +0000 Subject: [PATCH] Bug 29403: Fix api/v1/patrons.t t::lib::Dates::compare expects either correct DateTime objects, or a system formatted datetime strings to be passed.. but as we're testing the API, we are consistently using RFC3339 strings for date-times and ISO8601 strings for dates. We need to therefore pre-process the strings into DateTime objects for the comparison. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- t/db_dependent/api/v1/patrons.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t index c3726f54bb..928d5dd446 100755 --- a/t/db_dependent/api/v1/patrons.t +++ b/t/db_dependent/api/v1/patrons.t @@ -553,7 +553,11 @@ subtest 'update() tests' => sub { my $updated_on_got = delete $got->{updated_on}; my $updated_on_expected = delete $newpatron->{updated_on}; is_deeply($got, $newpatron, 'Returned patron from update matches expected'); - t::lib::Dates::compare( $updated_on_got, $updated_on_expected, 'updated_on values matched' ); + t::lib::Dates::compare( + dt_from_string( $updated_on_got, 'rfc3339' ), + dt_from_string( $updated_on_expected, 'rfc3339' ), + 'updated_on values matched' + ); is(Koha::Patrons->find( $patron_2->id )->cardnumber, $newpatron->{ cardnumber }, 'Patron is really updated!'); -- 2.20.1