Bugzilla – Attachment 123245 Details for
Bug 28632
patrons.t fragile on slow boxes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28632: Prevent api/v1/patrons.t to fail on dates comparison
Bug-28632-Prevent-apiv1patronst-to-fail-on-dates-c.patch (text/plain), 1.86 KB, created by
Jonathan Druart
on 2021-07-28 10:25:49 UTC
(
hide
)
Description:
Bug 28632: Prevent api/v1/patrons.t to fail on dates comparison
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-07-28 10:25:49 UTC
Size:
1.86 KB
patch
obsolete
>From 23ad09a20e2e0183eab420e4c16fce1a8fbe2086 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 28 Jul 2021 12:24:14 +0200 >Subject: [PATCH] Bug 28632: Prevent api/v1/patrons.t to fail on dates > comparison > > # Failed test 'Returned patron from update matches expected' > # at t/db_dependent/api/v1/patrons.t line 537. > # Structures begin differing at: > # $got->{updated_on} = '2021-07-27T13:33:53+00:00' > # $expected->{updated_on} = '2021-07-27T13:33:52+00:00' > # Looks like you failed 1 test of 42. >--- > t/db_dependent/api/v1/patrons.t | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t >index 441120f23a5..5b1e33119b8 100755 >--- a/t/db_dependent/api/v1/patrons.t >+++ b/t/db_dependent/api/v1/patrons.t >@@ -24,6 +24,7 @@ use Test::Warn; > > use t::lib::TestBuilder; > use t::lib::Mocks; >+use t::lib::Dates; > > use C4::Auth; > use Koha::Database; >@@ -534,7 +535,13 @@ subtest 'update() tests' => sub { > $newpatron->{patron_id} = $unauthorized_patron->to_api->{patron_id}; > $newpatron->{restricted} = $unauthorized_patron->to_api->{restricted}; > $newpatron->{anonymized} = $unauthorized_patron->to_api->{anonymized}; >- is_deeply($result->tx->res->json, $newpatron, 'Returned patron from update matches expected'); >+ >+ my $got = $result->tx->res->json; >+ 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' ); >+ > > is(Koha::Patrons->find( $patron_2->id )->cardnumber, > $newpatron->{ cardnumber }, 'Patron is really updated!'); >-- >2.20.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 28632
:
122447
|
122460
|
122739
| 123245