Bug 5284 - Generic report covering various problems with the labels/patron card tests
authorChris Nighswonger <cnighswonger@foundations.edu>
Wed, 6 Oct 2010 17:33:16 +0000 (13:33 -0400)
committerChris Nighswonger <cnighswonger@foundations.edu>
Wed, 6 Oct 2010 17:33:16 +0000 (13:33 -0400)
This patch fixes the C4::Labels::Template tests

C4/Creators/Template.pm
t/db_dependent/Labels/t_Template.t

index 0bbeadf..8a7564c 100644 (file)
@@ -154,7 +154,7 @@ sub delete {
         warn sprintf('%s : Cannot delete template as the creator type is invalid or non-existant.', $call_type) if !$query_params[1];
         return -1;
     }
-    my $query = "DELETE FROM " . $opts{'table_name'} . " WHERE template_id = ? AND creator = ?";
+    my $query = "DELETE FROM creator_templates WHERE template_id = ? AND creator = ?";
     my $sth = C4::Context->dbh->prepare($query);
     $sth->execute(@query_params);
     $self->{'template_stat'} = 0;
index bd57a23..9c5d276 100644 (file)
@@ -20,7 +20,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 52;
+use Test::More tests => 54;
 use C4::Context;
 use Data::Dumper;
 
@@ -29,6 +29,7 @@ BEGIN {
 }
 
 my $expect_template = {
+        creator         =>      'Labels',
         profile_id      =>      0,
         template_code   =>      'DEFAULT TEMPLATE',
         template_desc   =>      'Default description',
@@ -61,6 +62,7 @@ foreach my $key (keys %{$expect_template}) {
 
 diag "Testing Template->set_attr() method.";
 my $new_attr = {
+    creator             => 'Labels',
     profile_id          => 0,
     template_code       => 'Avery 5160 | 1 x 2-5/8',
     template_desc       => '3 columns, 10 rows of labels',