diff --git a/t/db_dependent/DecreaseLoanHighHolds.t b/t/db_dependent/DecreaseLoanHighHolds.t index b35dbfd14e..a85048f4b9 100755 --- a/t/db_dependent/DecreaseLoanHighHolds.t +++ b/t/db_dependent/DecreaseLoanHighHolds.t @@ -45,7 +45,7 @@ $dbh->do('DELETE FROM items'); my $now_value = DateTime->now(); my $mocked_datetime = Test::MockModule->new('DateTime'); -$mocked_datetime->mock( 'now', sub { return $now_value; } ); +$mocked_datetime->mock( 'now', sub { return $now_value->clone; } ); my $library = $builder->build( { source => 'Branch' } ); my $category = $builder->build( { source => 'Category' } ); diff --git a/t/db_dependent/Sitemapper.t b/t/db_dependent/Sitemapper.t index bf2576b43c..a4cbcac0f5 100755 --- a/t/db_dependent/Sitemapper.t +++ b/t/db_dependent/Sitemapper.t @@ -34,7 +34,7 @@ BEGIN { my $now_value = DateTime->now(); my $mocked_datetime = Test::MockModule->new('DateTime'); -$mocked_datetime->mock( 'now', sub { return $now_value; } ); +$mocked_datetime->mock( 'now', sub { return $now_value->clone; } ); sub slurp { my $file = shift;