Bug 23382: Use floating time zone to prevent tests to fail because of DST

Today Friday Oct 25th, DST next Sunday => Date math are wrong, 96 hours
diff becomes 95.
To avoid that we use the floating timezone

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d4af82d411)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2019-10-25 15:28:49 +02:00 committed by Lucas Gass
parent 56a1c93ffc
commit 2419a083fd
1 changed files with 4 additions and 4 deletions

View File

@ -90,11 +90,11 @@ my $patron = $builder->build_object(
}
);
my $dt = dt_from_string();
Time::Fake->offset( $dt->epoch );
my $now = dt_from_string()->set_time_zone('floating');
Time::Fake->offset( $now->epoch );
my $dt_from = dt_from_string()->subtract( days => 2 );
my $dt_to = dt_from_string()->add( days => 4 );
my $dt_from = $now->clone->subtract( days => 2 );
my $dt_to = $now->clone->add( days => 4 );
subtest 'new' => sub {
plan tests => 9;