devtools/testlib.py
branchstable
changeset 3913 60f31797e01e
parent 3764 034aa14b740a
child 3956 5d1b8fc9cb98
--- 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()