add test for IDENTITY_INSERT
[dbsrgits/DBIx-Class.git] / t / delete / m2m.t
1 #!/usr/bin/perl -w
2
3 use strict;
4 use warnings;  
5
6 use Test::More;
7 use lib qw(t/lib);
8 use DBICTest;
9
10 my $schema = DBICTest->init_schema();
11
12 plan tests => 5;
13
14 my $cd = $schema->resultset("CD")->find(2);
15 ok $cd->liner_notes;
16 ok keys %{$cd->{_relationship_data}}, "_relationship_data populated";
17
18 $cd->discard_changes;
19 ok $cd->liner_notes, 'relationships still valid after discarding changes';
20
21 ok $cd->liner_notes->delete;
22 $cd->discard_changes;
23 ok !$cd->liner_notes, 'discard_changes resets relationship';