Avoid ResultSourceProxy calls whenever possible
[dbsrgits/DBIx-Class-Historic.git] / t / delete / m2m.t
CommitLineData
e60dc79f 1use strict;
f54428ab 2use warnings;
e60dc79f 3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
7
8my $schema = DBICTest->init_schema();
9
e60dc79f 10my $cd = $schema->resultset("CD")->find(2);
11ok $cd->liner_notes;
65d35121 12
13ok scalar(keys %{$cd->{_relationship_data}}), "_relationship_data populated";
e60dc79f 14
15$cd->discard_changes;
16ok $cd->liner_notes, 'relationships still valid after discarding changes';
17
18ok $cd->liner_notes->delete;
19$cd->discard_changes;
f54428ab 20ok !$cd->liner_notes, 'discard_changes resets relationship';
21
22done_testing;