Bug 7317: (followup) Make tests independent of data on the DB
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 6 Nov 2017 16:51:43 +0000 (13:51 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 9 Nov 2017 14:42:15 +0000 (11:42 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Illrequest.pm
t/db_dependent/Illrequestattributes.t
t/db_dependent/Illrequests.t

index 5f6ee12..db5b9a9 100644 (file)
@@ -25,7 +25,6 @@ use File::Basename qw/basename/;
 use Koha::Database;
 use Koha::Email;
 use Koha::Exceptions::Ill;
-use Koha::Illrequest;
 use Koha::Illrequestattributes;
 use Koha::Patron;
 use Mail::Sendmail;
index 0eb5d5c..d81215f 100644 (file)
@@ -34,6 +34,8 @@ subtest 'Basic object tests' => sub {
 
     $schema->storage->txn_begin;
 
+    Koha::Illrequestattributes->search->delete;
+
     my $builder = t::lib::TestBuilder->new;
 
     my $illrqattr = $builder->build({ source => 'Illrequestattribute' });
index fd5772f..4259a70 100644 (file)
@@ -103,6 +103,8 @@ subtest 'Working with related objects' => sub {
 
     $schema->storage->txn_begin;
 
+    Koha::Illrequests->search->delete;
+
     my $patron = $builder->build({ source => 'Borrower' });
     my $illrq = $builder->build({
         source => 'Illrequest',