[devtools] do not forbid use of postgres as a source for tests (but it still needs proper dump/restore support) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 15 Apr 2010 10:59:49 +0200
branchstable
changeset 5267 7bac6791bbc2
parent 5266 84f285d96363
child 5268 b4bb59824d72
[devtools] do not forbid use of postgres as a source for tests (but it still needs proper dump/restore support)
devtools/__init__.py
devtools/testlib.py
--- a/devtools/__init__.py	Thu Apr 15 10:58:21 2010 +0200
+++ b/devtools/__init__.py	Thu Apr 15 10:59:49 2010 +0200
@@ -217,8 +217,10 @@
     driver = config.sources()['system']['db-driver']
     if driver == 'sqlite':
         reset_test_database_sqlite(config)
-    elif driver == 'sqlserver2005':
-        reset_test_database_sqlserver2005(config)
+    elif driver in ('sqlserver2005', 'postgres'):
+        # XXX do something with dump/restore ?
+        print 'resetting the database is not done for', driver
+        print 'you should handle it manually'
     else:
         raise ValueError('no reset function for driver %r' % driver)
 
@@ -239,9 +241,6 @@
         from cubicweb.server import init_repository
         init_repository(config, interactive=False, drop=True, vreg=vreg)
 
-def reset_test_database_sqlserver2005(config):
-    pass
-
 ### sqlite test database handling ##############################################
 
 def cleanup_sqlite(dbfile, removetemplate=False):
--- a/devtools/testlib.py	Thu Apr 15 10:58:21 2010 +0200
+++ b/devtools/testlib.py	Thu Apr 15 10:59:49 2010 +0200
@@ -130,6 +130,7 @@
 
 class CubicWebTC(TestCase):
     """abstract class for test using an apptest environment
+
     attributes:
 
     * `vreg`, the vregistry
@@ -141,7 +142,6 @@
     * `repo`, the repository object
     * `admlogin`, login of the admin user
     * `admpassword`, password of the admin user
-
     """
     appid = 'data'
     configcls = devtools.ApptestConfiguration