Bug 34930: Change timezone in Koha/Object.t where tests assume it

This is the case for subtest: attributes_from_api() tests.

Test plan:
export TZ='Europe/Amsterdam'
prove t/db_dependent/Koha/Object.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2023-09-27 13:57:49 +02:00 committed by Tomas Cohen Arazi
parent 6109a41ca6
commit 0fb84e424e
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 7 additions and 0 deletions

View File

@ -690,6 +690,10 @@ subtest 'attributes_from_api() tests' => sub {
my $patron = Koha::Patron->new();
delete $C4::Context::context->{tz};
local %ENV;
$ENV{TZ} = 'Etc/UTC'; # following tests implicitly assume it
my $attrs = $patron->attributes_from_api(
{
updated_on => '2019-12-27T14:53:00Z',
@ -761,6 +765,9 @@ subtest 'attributes_from_api() tests' => sub {
'date_of_birth',
'Exception parameter is the API field name, not the DB one'
);
# Remove timezone change
delete $C4::Context::context->{tz};
};
subtest 'booleans handling tests' => sub {