On 30 Mar 2006, at 12:14, Richard Jolly wrote:
I have a simple cascade delete test that fails under 6.0 but passed under 5.007.
I've written this as a failing test against trunk. I'd expect its something I've misunderstood rather than a real bug, but here it is anyway. Inline as a patch, and two files attached in case I've got the patch wrong.
Richard
26cascade_delete.t
Description: Binary data
26cascade_delete.tl
Description: Binary data
==== Patch <cascade_delete> level 1 Source: [No source]Target: 58e6d779-1806-0410-870b-b3f1ff428cff:/local/dbix-class/t:7330 [local]
Log:
cascade_delete test
=== basicrels/26cascade_delete.t
==================================================================
--- basicrels/26cascade_delete.t (revision 7330)
+++ basicrels/26cascade_delete.t (patch cascade_delete level 1)
@@ -0,0 +1,7 @@
+use Test::More;
+use lib qw(t/lib);
+use DBICTest;
+use DBICTest::BasicRels;
+
+require "t/run/26cascade_delete.tl";
+run_tests(DBICTest->schema);
=== run/26cascade_delete.tl
==================================================================
--- run/26cascade_delete.tl (revision 7330)
+++ run/26cascade_delete.tl (patch cascade_delete level 1)
@@ -0,0 +1,15 @@
+use strict;
+use warnings;
+
+sub run_tests {
+my $schema = shift;
+
+plan tests => 2;
+my $artist = $schema->resultset('Artist')->find(1);
+
+$artist->delete;
+is( $schema->resultset('Artist')->count, 0, 'artist deleted');
+is( $schema->resultset('CD')->search({artist => 1})->count, 0,
'related cds deleted');
+ +} +1;
_______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
