Skip to content

Commit e82bd59

Browse files
authored
Merge pull request #144 from gisce/fix_check_test_model_acces_rules
fix check test classes
2 parents d108947 + 05c63c4 commit e82bd59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

destral/testing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def test_access_rules(self):
164164
"""Test access rules for all the models created in the module
165165
"""
166166
logger.info('Testing access rules for module %s', self.config['module'])
167+
model_obj = self.openerp.pool.get('ir.model')
167168
imd_obj = self.openerp.pool.get('ir.model.data')
168169
access_obj = self.openerp.pool.get('ir.model.access')
169170
no_access = []
@@ -181,7 +182,8 @@ def test_access_rules(self):
181182
if imd_ids:
182183
for imd in imd_obj.browse(txn.cursor, txn.user, imd_ids):
183184
model_id = imd.res_id
184-
if getattr(self.openerp.pool.get(imd.model), '_test_class', False):
185+
pool_model = model_obj.read(txn.cursor, txn.user, model_id, ['model'])['model']
186+
if getattr(self.openerp.pool.get(pool_model), '_test_class', False):
185187
continue
186188
access_ids = access_obj.search(cursor, uid, [
187189
('model_id.id', '=', model_id)

0 commit comments

Comments
 (0)