-use Test::More;
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
use strict;
use warnings;
-use lib qw(t/lib);
-use DBICTest;
+use Test::More;
-plan tests => 4;
+
+use DBICTest;
my $schema = DBICTest->init_schema();
$a2_cds->search ({}, { rows => 1})->delete;
is ($cdrs->count, $total_cds -= 1, 'related + limit delete ok');
-TODO: {
+{
local $TODO = 'delete_related is based on search_related which is based on search which does not understand object arguments';
+ local $SIG{__WARN__} = sub {}; # trap the non-numeric warning, remove when the TODO is removed
+
my $cd2pr_count = $cd2pr_rs->count;
$prod_cd->delete_related('cd_to_producer', { producer => $prod } );
is ($cd2pr_rs->count, $cd2pr_count -= 1, 'm2m link deleted succesfully');
+
+ # see 187ec69a for why this is neccessary
+ $prod->result_source(undef);
}
+
+done_testing;