From a56d6c8fb960de7fdadc3a635935da472cc5eda8 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 24 Mar 2004 06:18:59 +0000 Subject: [PATCH] minor pre-release / test fixes git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2175 57a73879-2fb5-44c3-a270-3262357dd7e2 --- MANIFEST.in | 2 +- roundup/backends/back_postgresql.py | 1 - roundup/cgi/actions.py | 4 ++-- roundup/cgi/client.py | 4 ++-- roundup/cgi/form_parser.py | 2 +- test/test_mysql.py | 3 ++- test/test_postgresql.py | 7 +++++-- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index fb9bba3..3ab500f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,7 +8,7 @@ recursive-include doc *.html *.png *.txt *.css *.1 recursive-include detectors *.py recursive-include templates *.* home* page* global-exclude .cvsignore *.pyc *.pyo -include run_tests *.txt demo.py +include run_tests.py *.txt demo.py exclude BUILD.txt I18N_PROGRESS.txt TODO.txt exclude doc/security.txt doc/templating.txt diff --git a/roundup/backends/back_postgresql.py b/roundup/backends/back_postgresql.py index 4882492..5e6214c 100644 --- a/roundup/backends/back_postgresql.py +++ b/roundup/backends/back_postgresql.py @@ -8,7 +8,6 @@ '''Postgresql backend via psycopg for Roundup.''' __docformat__ = 'restructuredtext' - import os, shutil, popen2, time import psycopg diff --git a/roundup/cgi/actions.py b/roundup/cgi/actions.py index 3859f96..33e7281 100755 --- a/roundup/cgi/actions.py +++ b/roundup/cgi/actions.py @@ -499,7 +499,7 @@ class NewItemAction(_EditAction): ''' # parse the props from the form try: - props, links = self.client.parsePropsFromForm(create=True) + props, links = self.client.parsePropsFromForm(create=1) except (ValueError, KeyError), message: self.client.error_message.append(_('Error: ') + str(message)) return @@ -671,7 +671,7 @@ class RegisterAction(Action): Return 1 on successful login. """ - props = self.client.parsePropsFromForm(create=True)[0][('user', None)] + props = self.client.parsePropsFromForm(create=1)[0][('user', None)] # registration isn't allowed to supply roles if props.has_key('roles'): diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 03cfa64..045dce1 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.166 2004-03-18 01:58:46 richard Exp $ +# $Id: client.py,v 1.167 2004-03-24 06:18:59 richard Exp $ """WWW request handler (also used in the stand-alone server). """ @@ -650,6 +650,6 @@ class Client: except MessageSendError, e: self.error_message.append(str(e)) - def parsePropsFromForm(self, create=False): + def parsePropsFromForm(self, create=0): return FormParser(self).parse(create=create) diff --git a/roundup/cgi/form_parser.py b/roundup/cgi/form_parser.py index 8ef534d..3db747a 100755 --- a/roundup/cgi/form_parser.py +++ b/roundup/cgi/form_parser.py @@ -34,7 +34,7 @@ class FormParser: self.classname = client.classname self.nodeid = client.nodeid - def parse(self, create=False, num_re=re.compile('^\d+$')): + def parse(self, create=0, num_re=re.compile('^\d+$')): """ Item properties and their values are edited with html FORM variables and their values. You can: diff --git a/test/test_mysql.py b/test/test_mysql.py index 1fdc941..e30e0b1 100644 --- a/test/test_mysql.py +++ b/test/test_mysql.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_mysql.py,v 1.8 2004-03-18 01:58:46 richard Exp $ +# $Id: test_mysql.py,v 1.9 2004-03-24 06:18:59 richard Exp $ import unittest, os, shutil, time, imp @@ -90,6 +90,7 @@ class mysqlSessionTest(mysqlOpener, RDBMSTest): def test_suite(): suite = unittest.TestSuite() if not hasattr(backends, 'mysql'): + print "Skipping mysql tests" return suite from roundup.backends import mysql diff --git a/test/test_postgresql.py b/test/test_postgresql.py index 81ce5dc..143916d 100644 --- a/test/test_postgresql.py +++ b/test/test_postgresql.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_postgresql.py,v 1.6 2004-03-18 01:58:46 richard Exp $ +# $Id: test_postgresql.py,v 1.7 2004-03-24 06:18:59 richard Exp $ import unittest @@ -28,13 +28,13 @@ from db_test_base import DBTest, ROTest, config, SchemaTest, ClassicInitTest config.POSTGRESQL_DATABASE = {'database': 'rounduptest'} from roundup import backends -from roundup.backends.back_postgresql import db_nuke, db_create, db_exists class postgresqlOpener: if hasattr(backends, 'postgresql'): from roundup.backends import postgresql as module def setUp(self): + #from roundup.backends.back_postgresql import db_nuke #db_nuke(config, 1) pass @@ -43,6 +43,7 @@ class postgresqlOpener: def nuke_database(self): # clear out the database - easiest way is to nuke and re-create it + from roundup.backends.back_postgresql import db_nuke db_nuke(config) class postgresqlDBTest(postgresqlOpener, DBTest): @@ -104,9 +105,11 @@ class postgresqlSessionTest(postgresqlOpener, RDBMSTest): def test_suite(): suite = unittest.TestSuite() if not hasattr(backends, 'postgresql'): + print "Skipping mysql tests" return suite # make sure we start with a clean slate + from roundup.backends.back_postgresql import db_nuke db_nuke(config, 1) # TODO: Check if we can run postgresql tests -- 2.30.2