Restore 'timezone' field in column info ( extends eef9b484 )
[dbsrgits/DBIx-Class.git] / t / icdt / offline_pg.t
index 0a04be6..bfd931c 100644 (file)
@@ -1,11 +1,12 @@
-use DBIx::Class::Optional::Dependencies -skip_all_without => qw( icdt_pg );
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt_pg );
 
 use strict;
 use warnings;
 
 use Test::More;
 use Test::Warn;
-use lib qw(t/lib);
+
 use DBICTest;
 
 DBICTest::Schema->load_classes('EventTZPg');
@@ -22,11 +23,22 @@ DBICTest::Schema->load_classes('EventTZPg');
   my $parser = $s->storage->datetime_parser;
   is( $parser, 'DateTime::Format::Pg', 'datetime_parser is as expected');
 
+  my $colinfo = $s->source('EventTZPg')->column_info('created_on');
+  is (
+    $colinfo->{timezone},
+    $colinfo->{time_zone},
+    'Legacy timezone key is still present in colinfo',
+  );
+
   ok (!$s->storage->_dbh, 'still not connected');
 }
 
 my $schema = DBICTest->init_schema();
 
+# this may generate warnings under certain CI flags, hence do it outside of
+# the warnings_are below
+my $dt = DateTime->new( year => 2000, time_zone => "America/Chicago" );
+
 warnings_are {
   my $event = $schema->resultset("EventTZPg")->find(1);
   $event->update({created_on => '2009-01-15 17:00:00+00'});