changeset 2107:b7404a96b58a 0.7.0b1

minor pre-release / test fixes
author Richard Jones <richard@users.sourceforge.net>
date Wed, 24 Mar 2004 06:18:59 +0000
parents 12a902ea1dcd
children 54815ca493a5
files MANIFEST.in roundup/backends/back_postgresql.py roundup/cgi/actions.py roundup/cgi/client.py roundup/cgi/form_parser.py test/test_mysql.py test/test_postgresql.py
diffstat 7 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MANIFEST.in	Wed Mar 24 05:56:49 2004 +0000
+++ b/MANIFEST.in	Wed Mar 24 06:18:59 2004 +0000
@@ -8,7 +8,7 @@
 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
 
--- a/roundup/backends/back_postgresql.py	Wed Mar 24 05:56:49 2004 +0000
+++ b/roundup/backends/back_postgresql.py	Wed Mar 24 06:18:59 2004 +0000
@@ -8,7 +8,6 @@
 '''Postgresql backend via psycopg for Roundup.'''
 __docformat__ = 'restructuredtext'
 
-
 import os, shutil, popen2, time
 import psycopg
 
--- a/roundup/cgi/actions.py	Wed Mar 24 05:56:49 2004 +0000
+++ b/roundup/cgi/actions.py	Wed Mar 24 06:18:59 2004 +0000
@@ -499,7 +499,7 @@
         '''
         # 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 @@
 
         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'):
--- a/roundup/cgi/client.py	Wed Mar 24 05:56:49 2004 +0000
+++ b/roundup/cgi/client.py	Wed Mar 24 06:18:59 2004 +0000
@@ -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 @@
         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)
 
--- a/roundup/cgi/form_parser.py	Wed Mar 24 05:56:49 2004 +0000
+++ b/roundup/cgi/form_parser.py	Wed Mar 24 06:18:59 2004 +0000
@@ -34,7 +34,7 @@
         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:
 
--- a/test/test_mysql.py	Wed Mar 24 05:56:49 2004 +0000
+++ b/test/test_mysql.py	Wed Mar 24 06:18:59 2004 +0000
@@ -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 @@
 def test_suite():
     suite = unittest.TestSuite()
     if not hasattr(backends, 'mysql'):
+        print "Skipping mysql tests"
         return suite
 
     from roundup.backends import mysql
--- a/test/test_postgresql.py	Wed Mar 24 05:56:49 2004 +0000
+++ b/test/test_postgresql.py	Wed Mar 24 06:18:59 2004 +0000
@@ -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 @@
 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 @@
 
     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 @@
 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

Roundup Issue Tracker: http://roundup-tracker.org/