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