8 my $schema = DBICTest->init_schema();
11 eval "use DBD::SQLite";
12 plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 6);
15 my $art = $schema->resultset("Artist")->find(1);
17 isa_ok $art => 'DBICTest::Artist';
19 my $name = 'Caterwauler McCrae';
21 ok($art->name($name) eq $name, 'update');
24 my @changed_keys = $art->is_changed;
25 is( scalar (@changed_keys), 0, 'field changed but same value' );
28 $art->discard_changes;
30 ok($art->update({ artistid => 100 }), 'update allows pk mutation');
32 is($art->artistid, 100, 'pk mutation applied');
34 my $art_100 = $schema->resultset("Artist")->find(100);
35 $art_100->artistid(101);
36 ok($art_100->update(), 'update allows pk mutation via column accessor');