BEGIN { use_ok('Koha::DateUtils'); }
+t::lib::Mocks::mock_preference('dateformat', 'us');
+t::lib::Mocks::mock_preference('TimeFormat', 'This_is_not_used_but_called');
+
my $tz = C4::Context->tz;
isa_ok( $tz, 'DateTime::TimeZone', 'Context returns timezone object' );
my $date_string;
-my $module_context = new Test::MockModule('C4::Context');
-
-t::lib::Mocks::mock_preference('dateformat', 'us');
-
my $dateformat = C4::Context->preference('dateformat');
cmp_ok output_pref({ dt => $dt, dateformat => $dateformat }),
'eq',
my $now = DateTime->now;
is( dt_from_string, $now, "Without parameter, dt_from_string should return today" );
+my $module_context = new Test::MockModule('C4::Context');
$module_context->mock(
'tz',
sub {