]> wagnertech.de Git - mfinanz.git/blobdiff - t/Support/TestSetup.pm
Test-Run-Script ohne Harness
[mfinanz.git] / t / Support / TestSetup.pm
index 7e5774ea1878e93457d2ba37ac76ada9adcef5da..d74e66a7b423cf2389e185a1b11cccc11211e991 100644 (file)
@@ -44,12 +44,16 @@ sub login {
 
   die "cannot find user $login"            unless %::myconfig = $::auth->read_user(login => $login);
 
 
   die "cannot find user $login"            unless %::myconfig = $::auth->read_user(login => $login);
 
-  $::form->{login} = $login; # normaly implicit at login
-
   die "cannot find locale for user $login" unless $::locale   = Locale->new($::myconfig{countrycode});
 
   $SIG{__DIE__} = sub { Carp::confess( @_ ) } if $::lx_office_conf{debug}->{backtrace_on_die};
 
   die "cannot find locale for user $login" unless $::locale   = Locale->new($::myconfig{countrycode});
 
   $SIG{__DIE__} = sub { Carp::confess( @_ ) } if $::lx_office_conf{debug}->{backtrace_on_die};
 
+  # Always use English locale for messages from the database during
+  # tests.
+  my $query = qq|SET lc_messages = 'en_US.UTF-8'|;
+  SL::DB->auth->dbh->do($query)   || die 'Cannot set database locale to en_US.UTF-8 for auth database';
+  SL::DB->client->dbh->do($query) || die 'Cannot set database locale to en_US.UTF-8 for main database';
+
   return 1;
 }
 
   return 1;
 }