1 package Support::TestSetup;
6 use CGI qw( -no_xhtml);
13 use SL::InstanceConfiguration;
18 die 'need login' unless $login;
22 $::lxdebug = LXDebug->new(file => \*STDERR);
23 $::locale = Locale->new($::lx_office_conf{system}->{language});
25 $::auth = SL::Auth->new;
26 $::instance_conf = SL::InstanceConfiguration->new;
27 $::request = { cgi => CGI->new({}) };
29 die 'cannot reach auth db' unless $::auth->session_tables_present;
31 $::auth->restore_session;
33 require "bin/mozilla/common.pl";
35 die "cannot find user $login" unless %::myconfig = $::auth->read_user(login => $login);
37 $::form->{login} = $login; # normaly implicit at login
39 die "cannot find locale for user $login" unless $::locale = Locale->new($::myconfig{countrycode});
41 $::instance_conf->init;
47 SL::LxOfficeConf->read;
49 my $login = shift || $::lx_office_conf{testing}{login} || 'demo';