ignore validation error during auto-population of a test db stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 24 Nov 2009 10:51:29 +0100
branchstable
changeset 3913 60f31797e01e
parent 3912 412eb366740b
child 3914 36be7a5e53ad
ignore validation error during auto-population of a test db
devtools/testlib.py
--- a/devtools/testlib.py	Tue Nov 24 10:51:02 2009 +0100
+++ b/devtools/testlib.py	Tue Nov 24 10:51:29 2009 +0100
@@ -14,6 +14,7 @@
 from logilab.common.testlib import InnerTest
 from logilab.common.pytest import nocoverage
 
+from cubicweb import ValidationError
 from cubicweb.devtools import VIEW_VALIDATORS
 from cubicweb.devtools.apptest import EnvBasedTC
 from cubicweb.devtools._apptest import unprotected_entities, SYSTEM_RELATIONS
@@ -150,7 +151,11 @@
         q = make_relations_queries(self.schema, edict, cu, ignored_relations,
                                    existingrels=existingrels)
         for rql, args in q:
-            cu.execute(rql, args)
+            try:
+                cu.execute(rql, args)
+            except ValidationError, ex:
+                # failed to satisfy some constraint
+                print 'error in automatic db population', ex
         self.post_populate(cu)
         self.commit()