4 # Class::DBI in its infinate wisdom allows implicit inflation
5 # and deflation of foriegn clas looups in has_a relationships.
6 # for inflate it would call ->new on the foreign_class and for
7 # deflate it would "" the column value and allow for overloading
11 use DBIx::Class::Optional::Dependencies;
14 plan skip_all => "Test needs ".DBIx::Class::Optional::Dependencies->req_missing_for('test_dt_sqlite')
15 unless DBIx::Class::Optional::Dependencies->req_ok_for('test_dt_sqlite');
18 use lib 't/cdbi/testlib';
21 ok(ImplicitInflate->can('db_Main'), 'set_db()');
22 is(ImplicitInflate->__driver, "SQLite", 'Driver set correctly');
24 my $now = DateTime->now;
26 ImplicitInflate->create({
27 update_datetime => $now,
31 my $implicit_inflate = ImplicitInflate->retrieve(text => 'Test Data');
33 ok($implicit_inflate->update_datetime->isa('DateTime'), 'Date column inflated correctly');
34 is($implicit_inflate->update_datetime => $now, 'Date has correct year');