Bugzilla – Attachment 128274 Details for
Bug 29403
dt_from_string should fail if passed more data than expected for the format
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29403: Fix api/v1/patrons.t
Bug-29403-Fix-apiv1patronst.patch (text/plain), 1.57 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-12-06 11:11:35 UTC
(
hide
)
Description:
Bug 29403: Fix api/v1/patrons.t
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-12-06 11:11:35 UTC
Size:
1.57 KB
patch
obsolete
>From e7017ff85d8a979dcb8891e6723550f8a12a2657 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >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 <tomascohen@theke.io> >--- > 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.34.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 29403
:
127246
|
127247
|
127254
|
128076
|
128077
|
128078
|
128272
|
128273
|
128274
|
128450
|
128451
|
128452
|
128825
|
128826
|
128827
|
128828
|
128829
|
129373
|
129374
|
129375
|
129376
|
129391
|
129392
|
129393
|
129394
|
129473
|
129486
|
129487
|
129488
|
129552
|
129553
|
129554
|
129555
|
129556