[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[3414] trunk
- Subject: SF.net SVN: ledger-smb:[3414] trunk
- From: ..hidden..
- Date: Sat, 02 Jul 2011 15:02:42 +0000
Revision: 3414
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3414&view=rev
Author: einhverfr
Date: 2011-07-02 15:02:41 +0000 (Sat, 02 Jul 2011)
Log Message:
-----------
All t/40-dbsetup.t tests now pass
All db routines now run quietly by default, logging both stderr and stdout
Modified Paths:
--------------
trunk/LedgerSMB/DBObject/Admin.pm
trunk/LedgerSMB/Database.pm
trunk/t/40-dbsetup.t
Modified: trunk/LedgerSMB/DBObject/Admin.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Admin.pm 2011-07-02 12:23:28 UTC (rev 3413)
+++ trunk/LedgerSMB/DBObject/Admin.pm 2011-07-02 15:02:41 UTC (rev 3414)
@@ -1,11 +1,11 @@
package LedgerSMB::DBObject::Admin;
-use base LedgerSMB::DBObject;
+use base qw(LedgerSMB::DBObject);
use LedgerSMB::Location;
-use LedgerSMB::DBObject::Employee;
use LedgerSMB::Contact;
use LedgerSMB::DBObject::Employee;
+use LedgerSMB::DBObject::User;
use LedgerSMB::Log;
my $logger = Log::Log4perl->get_logger("LedgerSMB::DBObject::Admin");
@@ -14,6 +14,7 @@
#[18:00:44] <aurynn> edit/create employee and add user features if needed.
sub save {
+ my $self = shift @_;
$self->error("Cannot save an Adminstrator object.");
}
Modified: trunk/LedgerSMB/Database.pm
===================================================================
--- trunk/LedgerSMB/Database.pm 2011-07-02 12:23:28 UTC (rev 3413)
+++ trunk/LedgerSMB/Database.pm 2011-07-02 15:02:41 UTC (rev 3414)
@@ -83,10 +83,10 @@
for my $contrib (@contrib_scripts){
my $rc2;
- $rc2=system("psql -f $ENV{PG_CONTRIB_DIR}/$contrib.sql 2>>$temp/dblog");
+ $rc2=system("psql -f $ENV{PG_CONTRIB_DIR}/$contrib.sql >> $temp/dblog_stdout 2>>$temp/dblog_stderr");
$rc ||= $rc2
}
- if (!system("psql -f $self->{source_dir}sql/Pg-database.sql 2>>$temp/dblog"
+ if (!system("psql -f $self->{source_dir}sql/Pg-database.sql >> $temp/dblog_stdout 2>>$temp/dblog_stderr"
)){
$rc = 1;
}
@@ -127,7 +127,7 @@
sub exec_script {
my ($self, $args) = @_;
open (LOG, '>>', $args->{log});
- open (PSQL, '-|', "psql -f $args->{script}");
+ open (PSQL, '-|', "psql -f $args->{script} 2>&1");
my $test = 0;
while (my $line = <PSQL>){
if ($line =~ /ERROR/){
Modified: trunk/t/40-dbsetup.t
===================================================================
--- trunk/t/40-dbsetup.t 2011-07-02 12:23:28 UTC (rev 3413)
+++ trunk/t/40-dbsetup.t 2011-07-02 15:02:41 UTC (rev 3414)
@@ -69,17 +69,18 @@
undef, undef, { AutoCommit => 0 });
my $dbh = $lsmb->{dbh};
ok($dbh, 'Connected to new database');
- my $sth = $dbh->prepare("select id from country where short_name = ?");
+ my $sth = $dbh->prepare("select id from country where short_name ilike ?");
$sth->execute($ENV{LSMB_COUNTRY_CODE});
- my $ref = $sth->fetchrow_array('name_LC');
+ my ($id) = $sth->fetchrow_array();
$sth->finish;
$lsmb->merge({username => $ENV{LSMB_ADMIN_USERNAME},
+ password => $ENV{LSMB_ADMIN_PASSWORD},
first_name => $ENV{LSMB_ADMIN_FNAME},
last_name => $ENV{LSMB_ADMIN_LNAME},
- country_id => $ref->{id},
+ country_id => $id,
});
my $user = LedgerSMB::DBObject::Admin->new({base => $lsmb});
- ok($user->save);
+ ok($user->save_user);
$sth = $dbh->prepare("SELECT admin__add_user_to_role(?, ?)");
my $rolename = "lsmb_" . $ENV{PGDATABASE} . "__users_manage";
ok($sth->execute($ENV{LSMB_ADMIN_USERNAME}, $rolename),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.