[MERGE] yml test: more explicit message when some data is missing.

bzr revid: vmt@openerp.com-20110513125218-gnbtcpm3jlgnflff
This commit is contained in:
Vo Minh Thu 2011-05-13 14:52:18 +02:00
commit 94401ff9c1
1 changed files with 24 additions and 18 deletions

View File

@ -174,8 +174,14 @@ class YamlInterpreter(object):
else:
module = self.module
checked_xml_id = xml_id
try:
_, id = self.pool.get('ir.model.data').get_object_reference(self.cr, self.uid, module, checked_xml_id)
self.id_map[xml_id] = id
except ValueError, e:
raise ValueError("""%s not found when processing %s.
This Yaml file appears to depend on missing data. This often happens for
tests that belong to a module's test suite and depend on each other.""" % (checked_xml_id, self.filename))
return id
def get_context(self, node, eval_dict):