From c22cd51ceae8683c31ad2fea7b2388a1c9262dfa Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 5 Aug 2015 17:41:51 -0400 Subject: [PATCH] LP#1481036 Ignore future backdates live test Signed-off-by: Bill Erickson Signed-off-by: Ben Shum --- .../perlmods/live_t/10-lp1481036-future-backdate.t | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Open-ILS/src/perlmods/live_t/10-lp1481036-future-backdate.t diff --git a/Open-ILS/src/perlmods/live_t/10-lp1481036-future-backdate.t b/Open-ILS/src/perlmods/live_t/10-lp1481036-future-backdate.t new file mode 100644 index 0000000000..a2490939c6 --- /dev/null +++ b/Open-ILS/src/perlmods/live_t/10-lp1481036-future-backdate.t @@ -0,0 +1,36 @@ +#!perl +use strict; use warnings; + +use Test::More tests => 3; + +diag("Tests handling of future backdates in checkin"); + +use constant ITEM_BARCODE => 'CONC4000070'; + +use DateTime; +use OpenILS::Utils::TestUtils; +my $script = OpenILS::Utils::TestUtils->new(); +$script->bootstrap; + +$script->authenticate({ + username => 'admin', + password => 'demo123', + type => 'staff' +}); + +ok($script->authtoken, 'Have an authtoken'); + +my $checkin_resp = $script->do_checkin({ + barcode => ITEM_BARCODE, + backdate => '3001-01-23' # date of the singularity; it is known. +}); + +is(ref $checkin_resp,'HASH','Checkin request returned a HASH'); + +my $ymd = DateTime->now->strftime('%F'); + +ok( + substr($checkin_resp->{payload}->{circ}->checkin_time, 0, 10) eq $ymd, + 'Checkin time matches current date, not backdate' +); + -- 2.11.0