Bug 23234: Mock DateTime->now using the time zone
The timezone of the two dt was different, one was UTC, the other one was my local one. When we mocked DateTime->now we did not use the time zone, we must use dt_from_string instead Test plan: Make sure your environment has a different time zone than UTC `prove t/db_dependent/Circulation.t` should fail without this patch Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
c4466e7d71
commit
549a09c521
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ my $builder = t::lib::TestBuilder->new;
|
|||
my $dbh = C4::Context->dbh;
|
||||
|
||||
# Prevent random failures by mocking ->now
|
||||
my $now_value = DateTime->now();
|
||||
my $now_value = dt_from_string;
|
||||
my $mocked_datetime = Test::MockModule->new('DateTime');
|
||||
$mocked_datetime->mock( 'now', sub { return $now_value->clone; } );
|
||||
|
||||
|
|
Loading…
Reference in a new issue