Fix to copy
[dbsrgits/DBIx-Class.git] / t / run / 22cascade_copy.tl
index 8c682e5..82642f2 100644 (file)
@@ -7,7 +7,16 @@ my $schema = shift;
 plan tests => 4;
 my $artist = $schema->resultset('Artist')->find(1);
 my $artist_cds = $artist->search_related('cds');
-my $cover_band = $artist->copy;
+
+my $cover_band;
+
+{
+  no warnings 'redefine';
+  local *DBICTest::Artist::result_source_instance = \&DBICTest::Schema::Artist::result_source_instance;
+
+  $cover_band = $artist->copy;
+}
+
 my $cover_cds = $cover_band->search_related('cds');
 cmp_ok($cover_band->id, '!=', $artist->id, 'ok got new column id...');
 is($cover_cds->count, $artist_cds->count, 'duplicated rows count ok');