Added copy test from Purge
[dbsrgits/DBIx-Class.git] / t / run / 10auto.tl
1 sub run_tests {
2
3 plan tests => 2;
4
5 DBICTest->class("Artist")->load_components(qw/PK::Auto::SQLite/);
6
7 # add an artist without primary key to test Auto
8 my $artist = DBICTest->class("Artist")->create( { name => 'Auto' } );
9 $artist->name( 'Auto Change' );
10 ok($artist->update, 'update on object created without PK ok');
11
12 my $copied = $artist->copy({ name => 'Don\'t tell the RIAA', artistid => undef });
13 is($copied->name, 'Don\'t tell the RIAA', "Copied with PKs ok.");
14
15 }
16
17 1;