Skip to content

Commit

Permalink
Merge pull request #153 from gisce/avoid_test_ceritain_views
Browse files Browse the repository at this point in the history
Skip View validation for redefined and controlled fields_get
  • Loading branch information
polsala authored Jul 5, 2024
2 parents 3c0f8ad + b288409 commit 13ed4ff
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions destral/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ class OOBaseTests(OOTestCase):
def test_all_views(self):
"""Tests all views defined in the module.
"""
try:
from tools import TestingExceptions
SkipViewValidation = TestingExceptions.SkipViewValidation
except:
SkipViewValidation = False
logger.info('Testing views for module %s', self.config['module'])
imd_obj = self.openerp.pool.get('ir.model.data')
view_obj = self.openerp.pool.get('ir.ui.view')
Expand Down Expand Up @@ -149,8 +154,13 @@ def test_all_views(self):
'not exist' % (view_xml_name, view.model)
)
logger.info('Testing view %s (id: %s) v%s', view.name, view.id, view.version)
model.fields_view_get(txn.cursor, txn.user, view.id,
view.type, version=view.version)
if SkipViewValidation:
try:
model.fields_view_get(txn.cursor, txn.user, view.id, view.type, version=view.version)
except TestingExceptions.SkipViewValidation:
continue
else:
model.fields_view_get(txn.cursor, txn.user, view.id, view.type, version=view.version)
if view.inherit_id:
version = view.version
while view.inherit_id:
Expand Down

0 comments on commit 13ed4ff

Please sign in to comment.