]> wagnertech.de Git - mfinanz.git/blobdiff - t/db_helper/acts_as_list.t
Consolidation and extended test runs
[mfinanz.git] / t / db_helper / acts_as_list.t
index 53338f757a39c2c687c4d7dd55e513648ed90945..482966ede07d881178d272f04295227358abafbe 100644 (file)
@@ -6,8 +6,10 @@ use strict;
 use lib 't';
 use utf8;
 
+use Carp;
 use Data::Dumper;
 use Support::TestSetup;
+use SL::DB::TaxZone;
 
 eval {
   require SL::DB::RequirementSpec;
@@ -24,10 +26,16 @@ if ($skip) {
   plan tests => 48;
 }
 
-my ($customer, $status, $type, $r_spec, @items);
+my ($customer, $taxzone, $status, $type, $r_spec, @items);
+
 
 sub init {
-  $customer = SL::DB::Customer->new(name => 'Test Customer', currency_id => $::instance_conf->get_currency_id)->save;
+  if ($::lx_office_conf{system}->{default_manager} eq "swiss") {
+    $taxzone  = SL::DB::Manager::TaxZone->find_by( description => 'Schweiz') || croak "No taxzone";
+  } else {
+    $taxzone  = SL::DB::Manager::TaxZone->find_by( description => 'Inland')  || croak "No taxzone";
+  }
+  $customer = SL::DB::Customer->new(name => 'Test Customer', currency_id => $::instance_conf->get_currency_id, taxzone_id => $taxzone->id)->save;
   $status   = SL::DB::Manager::RequirementSpecStatus->find_by(name => '', description => '') ||
               SL::DB::RequirementSpecStatus->new(name => '', description => '', position => 0)->save;
   $type     = SL::DB::Manager::RequirementSpecType->find_by(description => '') ||