From a8ceae6c99b00aefcba301b2f41033d84701f56a Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 23 Mar 2017 18:11:27 +0000 Subject: Fix bug if test run c. 55 hours before BST starts. The code was adding two days and seven/eight hours to a floating DateTime, which from 5-7pm on 23rd March 2017 created a DateTime between 1-2am on 26th March which does not exist in e.g. the UK. --- t/app/controller/alert_new.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/app/controller') diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t index 729f3a267..ea38f7c25 100644 --- a/t/app/controller/alert_new.t +++ b/t/app/controller/alert_new.t @@ -371,7 +371,7 @@ subtest "Test normal alert signups and that alerts are sent" => sub { } } - my $dt = DateTime->now()->add( days => 2); + my $dt = DateTime->now(time_zone => 'Europe/London')->add(days => 2); my $dt_parser = FixMyStreet::App->model('DB')->schema->storage->datetime_parser; @@ -486,7 +486,7 @@ subtest "Test signature template is used from cobrand" => sub { my $user2 = $mech->create_user_ok('alerts@example.com', name => 'Alert User' ); - my $dt = DateTime->now()->add( days => 2); + my $dt = DateTime->now(time_zone => 'Europe/London')->add(days => 2); my $dt_parser = FixMyStreet::App->model('DB')->schema->storage->datetime_parser; -- cgit v1.2.3