Bugzilla – Attachment 173909 Details for
Bug 36822
When creating a new patron via LDAP or Shibboleth 0000-00-00 is inserted for invalid updated_on
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36822: (QA follow-up): Fix now time in tests
Bug-36822-QA-follow-up-Fix-now-time-in-tests.patch (text/plain), 2.50 KB, created by
Pedro Amorim
on 2024-11-04 11:34:57 UTC
(
hide
)
Description:
Bug 36822: (QA follow-up): Fix now time in tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-11-04 11:34:57 UTC
Size:
2.50 KB
patch
obsolete
>From d9b2cac8fd530c6b0b3df2469396119df21caf56 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 4 Nov 2024 11:32:34 +0000 >Subject: [PATCH] Bug 36822: (QA follow-up): Fix now time in tests > >This is to prevent the scenario of tests failing if they take long to run, e.g.: > > # Failed test 'updated_on correctly saved on newly created user' > # at t/db_dependent/Auth_with_shibboleth.t line 317. > # Structures begin differing at: > # ->[0] = '2024-11-04 11:20:13' > # ->[0] = '2024-11-04 11:20:14 >--- > t/db_dependent/Auth_with_ldap.t | 3 ++- > t/db_dependent/Auth_with_shibboleth.t | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Auth_with_ldap.t b/t/db_dependent/Auth_with_ldap.t >index 8f7e87f38b..38f4dbca16 100755 >--- a/t/db_dependent/Auth_with_ldap.t >+++ b/t/db_dependent/Auth_with_ldap.t >@@ -276,10 +276,11 @@ subtest 'checkpw_ldap tests' => sub { > $welcome = 0; > > # replicate testing with checkpw >+ my $time_now = dt_from_string()->ymd . ' ' . dt_from_string()->hms; > C4::Auth::checkpw( 'hola', password => 'hey' ); > my $patron_replicated_from_auth = Koha::Patrons->search( { userid => 'hola' } )->next; > is( >- $patron_replicated_from_auth->updated_on, dt_from_string()->ymd . ' ' . dt_from_string()->hms, >+ $patron_replicated_from_auth->updated_on, $time_now, > "updated_on correctly saved on newly created user" > ); > >diff --git a/t/db_dependent/Auth_with_shibboleth.t b/t/db_dependent/Auth_with_shibboleth.t >index 5f1d8be0cd..18b27124b3 100755 >--- a/t/db_dependent/Auth_with_shibboleth.t >+++ b/t/db_dependent/Auth_with_shibboleth.t >@@ -309,6 +309,7 @@ subtest "checkpw_shib tests" => sub { > $ENV{'emailpro'} = 'me@myemail.com'; > $ENV{branchcode} = $library->branchcode; # needed since T::D::C does no longer hides the FK constraint > >+ my $time_now = dt_from_string()->ymd . ' ' . dt_from_string()->hms; > checkpw($shib_login); > ok my $new_user_autocreated = $schema->resultset('Borrower')->search( { 'userid' => 'test43210' }, { rows => 1 } ), > "new user found"; >@@ -316,7 +317,7 @@ subtest "checkpw_shib tests" => sub { > my $rec_autocreated = $new_user_autocreated->next; > is_deeply( > [ map { $rec_autocreated->$_ } qw/updated_on/ ], >- [ dt_from_string()->ymd . ' ' . dt_from_string()->hms ], >+ [$time_now], > 'updated_on correctly saved on newly created user' > ); > }; >-- >2.39.5
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 36822
:
173373
|
173374
|
173375
|
173376
|
173377
|
173385
|
173386
|
173387
|
173388
|
173389
|
173391
|
173392
|
173393
|
173394
|
173395
|
173402
|
173403
|
173404
|
173405
|
173406
|
173646
|
173903
|
173904
|
173905
|
173906
|
173907
|
173908
| 173909 |
174523
|
174525