Commit | Line | Data |
0567538f |
1 | sub run_tests { |
1edaf6fe |
2 | my $schema = shift; |
0567538f |
3 | |
2f6e5af9 |
4 | plan tests => 2; |
0567538f |
5 | |
1edaf6fe |
6 | $schema->class("Artist")->load_components(qw/PK::Auto::SQLite/); |
0567538f |
7 | |
8 | # add an artist without primary key to test Auto |
f9db5527 |
9 | my $artist = $schema->resultset("Artist")->create( { name => 'Auto' } ); |
0567538f |
10 | $artist->name( 'Auto Change' ); |
11 | ok($artist->update, 'update on object created without PK ok'); |
12 | |
2f6e5af9 |
13 | my $copied = $artist->copy({ name => 'Don\'t tell the RIAA', artistid => undef }); |
14 | is($copied->name, 'Don\'t tell the RIAA', "Copied with PKs ok."); |
15 | |
0567538f |
16 | } |
17 | |
18 | 1; |