X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdelete%2Frelated.t;fp=t%2Fdelete%2Frelated.t;h=f8e1d97707c101c7c1bf415c5a6e36ab3983e885;hb=fe0708a2d68b5d34b6bc6f7e70164c3e569f1dd0;hp=49cd88fa7ee8281eb2ee907d8ece6bcc9c3f4170;hpb=01272eb81fe3a43e0a2f7befa465cc669945d543;p=dbsrgits%2FDBIx-Class.git diff --git a/t/delete/related.t b/t/delete/related.t index 49cd88f..f8e1d97 100644 --- a/t/delete/related.t +++ b/t/delete/related.t @@ -1,11 +1,10 @@ -use Test::More; use strict; use warnings; +use Test::More; + use lib qw(t/lib); use DBICTest; -plan tests => 4; - my $schema = DBICTest->init_schema(); my $ars = $schema->resultset('Artist'); @@ -55,7 +54,14 @@ 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;