# HG changeset patch # User Sylvain Thénault # Date 1259056289 -3600 # Node ID 60f31797e01e3e3f0d4a551eaec90c53772b730f # Parent 412eb366740beb884e5652ea0ffcba202e3a3c11 ignore validation error during auto-population of a test db diff -r 412eb366740b -r 60f31797e01e 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()