Bugzilla – Attachment 156285 Details for
Bug 34489
Koha/Patrons.t: Subtests get_age and is_valid_age do not pass in another timezone
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34489: Fix timezone problem in Patrons.t
Bug-34489-Fix-timezone-problem-in-Patronst.patch (text/plain), 1.71 KB, created by
Marcel de Rooy
on 2023-09-27 12:17:45 UTC
(
hide
)
Description:
Bug 34489: Fix timezone problem in Patrons.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-09-27 12:17:45 UTC
Size:
1.71 KB
patch
obsolete
>From ae35a7f9a0f738bc554b8724d8dd6851335122f8 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 27 Sep 2023 14:13:45 +0200 >Subject: [PATCH] Bug 34489: Fix timezone problem in Patrons.t >Content-Type: text/plain; charset=utf-8 > >See also bug 34930. Using same approach. > >Test plan: >export TZ='Europe/Amsterdam' >prove t/db_dependent/Koha/Patrons.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/Patrons.t | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 880ec2c5a8..24d4f7a811 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -738,6 +738,11 @@ subtest 'get_routing_lists' => sub { > subtest 'get_age' => sub { > plan tests => 31; > >+ # Following tests implicitly assume timezone UTC >+ delete $C4::Context::context->{tz}; >+ local %ENV; >+ $ENV{TZ} = 'Etc/UTC'; >+ > my $patron = $builder->build( { source => 'Borrower' } ); > $patron = Koha::Patrons->find( $patron->{borrowernumber} ); > >@@ -815,11 +820,19 @@ subtest 'get_age' => sub { > } > > $patron->delete; >+ >+ # Remove timezone change >+ delete $C4::Context::context->{tz}; > }; > > subtest 'is_valid_age' => sub { > plan tests => 10; > >+ # Following tests implicitly assume timezone UTC >+ delete $C4::Context::context->{tz}; >+ local %ENV; >+ $ENV{TZ} = 'Etc/UTC'; >+ > my $dt = dt_from_string('2020-02-28'); > > Time::Fake->offset( $dt->epoch ); >@@ -897,6 +910,9 @@ subtest 'is_valid_age' => sub { > > $patron->delete; > $category->delete; >+ >+ # Remove timezone change >+ delete $C4::Context::context->{tz}; > }; > > subtest 'account' => sub { >-- >2.30.2
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 34489
:
154318
|
156285
|
156386