2 use strict; use warnings;
4 use Test::More tests => 3;
6 diag("Tests handling of future backdates in checkin");
8 use constant ITEM_BARCODE => 'CONC4000070';
11 use OpenILS::Utils::TestUtils;
12 my $script = OpenILS::Utils::TestUtils->new();
15 $script->authenticate({
17 password => 'demo123',
21 ok($script->authtoken, 'Have an authtoken');
23 my $checkin_resp = $script->do_checkin({
24 barcode => ITEM_BARCODE,
25 backdate => '3001-01-23' # date of the singularity; it is known.
28 is(ref $checkin_resp,'HASH','Checkin request returned a HASH');
30 my $ymd = DateTime->now->set_time_zone(DateTime::TimeZone->new( name => "local" ))->strftime('%F');
33 substr($checkin_resp->{payload}->{circ}->checkin_time, 0, 10) eq $ymd,
34 'Checkin time matches current date, not backdate'