@@ -, +, @@ --- t/db_dependent/Koha/Patrons.t | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) --- a/t/db_dependent/Koha/Patrons.t +++ a/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 { --