Bugzilla – Attachment 123454 Details for
Bug 28630
ILSDI::AuthenticatePatron should set borrowers.lastseen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28630: Improve date comparisons in tests
Bug-28630-Improve-date-comparisons-in-tests.patch (text/plain), 2.62 KB, created by
Jonathan Druart
on 2021-08-04 09:13:35 UTC
(
hide
)
Description:
Bug 28630: Improve date comparisons in tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-08-04 09:13:35 UTC
Size:
2.62 KB
patch
obsolete
>From 08b9f008a7932f6d3dcc2c4b4aa5aeee36044063 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 4 Aug 2021 11:12:41 +0200 >Subject: [PATCH] Bug 28630: Improve date comparisons in tests > >--- > t/db_dependent/ILSDI_Services.t | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index e04328faff2..72681afd699 100755 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -23,6 +23,7 @@ use Test::More tests => 10; > use Test::MockModule; > use t::lib::Mocks; > use t::lib::TestBuilder; >+use t::lib::Dates; > > use C4::Items qw( ModItemTransfer ); > use C4::Circulation qw( AddIssue ); >@@ -58,7 +59,7 @@ subtest 'AuthenticatePatron test' => sub { > value => { > cardnumber => undef, > password => Koha::AuthUtils::hash_password( $plain_password ), >- lastseen => "2001-01-01" >+ lastseen => "2001-01-01 12:34:56" > } > }); > >@@ -71,7 +72,7 @@ subtest 'AuthenticatePatron test' => sub { > is( $reply->{id}, $borrower->{borrowernumber}, "userid and password - Patron authenticated" ); > is( $reply->{code}, undef, "Error code undef"); > my $seen_patron = Koha::Patrons->find({ borrowernumber => $reply->{id} }); >- is( output_pref({str => $seen_patron->lastseen(), dateonly => 1}), output_pref({str => '2001-01-01', dateonly => 1}),'Last seen not updated if not tracking patrons'); >+ is( $seen_patron->lastseen(), '2001-01-01 12:34:56','Last seen not updated if not tracking patrons'); > > $query->param('password','ilsdi-passworD'); > $reply = C4::ILSDI::Services::AuthenticatePatron( $query ); >@@ -87,10 +88,11 @@ subtest 'AuthenticatePatron test' => sub { > t::lib::Mocks::mock_preference( 'TrackLastPatronActivity', '1' ); > $query->param( 'username', uc( $borrower->{userid} )); > $reply = C4::ILSDI::Services::AuthenticatePatron( $query ); >+ my $now = dt_from_string; > is( $reply->{id}, $borrower->{borrowernumber}, "userid is not case sensitive - Patron authenticated" ); > is( $reply->{code}, undef, "Error code undef"); > $seen_patron = Koha::Patrons->find({ borrowernumber => $reply->{id} }); >- is( output_pref({str => $seen_patron->lastseen(), dateonly => 1}), output_pref({dt => dt_from_string(), dateonly => 1}),'Last seen updated to today if tracking patrons'); >+ is( t::lib::Dates::compare( $seen_patron->lastseen, $now), 0, 'Last seen updated to today if tracking patrons' ); > > $query->param( 'username', $borrower->{cardnumber} ); > $reply = C4::ILSDI::Services::AuthenticatePatron( $query ); >-- >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 28630
:
122421
|
122422
|
122476
|
122477
|
122478
|
122490
|
122491
|
122492
|
122544
|
122545
|
122546
|
123448
|
123449
|
123450
| 123454