From: Jason Etheridge Date: Fri, 7 Nov 2014 18:00:10 +0000 (-0500) Subject: LP#1386260: DST bugs in perl live tests (03-overdue_circ.t) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=af4686075df25a85ad60905a4f4266ff6c800059;p=evergreen%2Fmasslnc.git LP#1386260: DST bugs in perl live tests (03-overdue_circ.t) Use safer date math to handle bug with DST Signed-off-by: Jason Etheridge Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/perlmods/live_t/03-overdue_circ.t b/Open-ILS/src/perlmods/live_t/03-overdue_circ.t index 7981d32f81..fd83b2cac5 100644 --- a/Open-ILS/src/perlmods/live_t/03-overdue_circ.t +++ b/Open-ILS/src/perlmods/live_t/03-overdue_circ.t @@ -145,13 +145,12 @@ if (my $bill_resp = $bill_req->recv) { } } -my $xact_start = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($circ->xact_start))->epoch; -my $due_date = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($circ->due_date))->epoch; -my $twenty_days = OpenSRF::Utils->interval_to_seconds('480 h 0 m 0 s'); +my $xact_start = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($circ->xact_start)); +my $due_date = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($circ->due_date)); # Rewrite history; technically we should rewrite status_changed_item on the copy as well, but, meh... -$circ->xact_start( $apputils->epoch2ISO8601($xact_start - $twenty_days) ); -$circ->due_date( $apputils->epoch2ISO8601($due_date - $twenty_days) ); +$circ->xact_start( $xact_start->subtract( days => 20 )->iso8601() ); +$circ->due_date( $due_date->subtract( days => 20 )->iso8601() ); $cstore_ses->connect; # need stateful connection my $xact = $cstore_ses->request('open-ils.cstore.transaction.begin')->gather(1);