X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ef9698b3c0b6536298e6b6512c1d4e5d0aa48c67..70c5caebbc8fa418b8a17fbbdb950770f8c2d21b:/t/Support/TestSetup.pm diff --git a/t/Support/TestSetup.pm b/t/Support/TestSetup.pm index c8095a993..d74e66a7b 100644 --- a/t/Support/TestSetup.pm +++ b/t/Support/TestSetup.pm @@ -16,6 +16,9 @@ use SL::InstanceConfiguration; use SL::Request; sub login { + $Data::Dumper::Sortkeys = 1; + $Data::Dumper::Indent = 2; + SL::LxOfficeConf->read; my $client = 'Unit-Tests'; @@ -41,14 +44,16 @@ sub 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}); - $::instance_conf->init; - $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; }