Only normalize conditions during resolution time, instead on every ->search
[dbsrgits/DBIx-Class.git] / t / ordered / cascade_delete.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7 use Test::Exception;
8
9 use DBICTest;
10
11 my $schema = DBICTest->init_schema();
12
13 {
14   my $artist = $schema->resultset ('Artist')->search ({}, { rows => 1})->single; # braindead sqlite
15   my $cd = $schema->resultset ('CD')->create ({
16     artist => $artist,
17     title => 'Get in order',
18     year => 2009,
19     tracks => [
20       { title => 'T1' },
21       { title => 'T2' },
22       { title => 'T3' },
23     ],
24   });
25
26   lives_ok (sub { $cd->delete}, "Cascade delete on ordered has_many doesn't bomb");
27 }
28
29 done_testing;