commit
af90f5f638
|
@ -1,9 +1,3 @@
|
||||||
from . import test_tax
|
from . import test_tax
|
||||||
from . import test_search
|
from . import test_search
|
||||||
from . import test_reconciliation
|
from . import test_reconciliation
|
||||||
|
|
||||||
fast_suite = [
|
|
||||||
test_tax,
|
|
||||||
test_search,
|
|
||||||
test_reconciliation,
|
|
||||||
]
|
|
||||||
|
|
|
@ -20,8 +20,4 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from . import test_account_followup
|
from . import test_account_followup
|
||||||
|
|
||||||
checks = [
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
test_account_followup,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
||||||
|
|
|
@ -20,8 +20,4 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from . import base_action_rule_test
|
from . import base_action_rule_test
|
||||||
|
|
||||||
checks = [
|
|
||||||
base_action_rule_test,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
from . import test_cases
|
from . import test_cases
|
||||||
|
|
||||||
checks = [test_cases]
|
|
||||||
|
|
|
@ -1,6 +1,2 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import test_qweb_float
|
from . import test_qweb_float
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_qweb_float
|
|
||||||
]
|
|
||||||
|
|
|
@ -20,9 +20,4 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from . import test_mail, test_ir_actions
|
from . import test_mail, test_ir_actions
|
||||||
|
|
||||||
checks = [
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
test_mail,
|
|
||||||
test_ir_actions,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
||||||
|
|
|
@ -20,7 +20,3 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from . import test_challenge
|
from . import test_challenge
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_challenge,
|
|
||||||
]
|
|
||||||
|
|
|
@ -19,10 +19,6 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from openerp.addons.hr_holidays.tests import test_holidays_flow
|
from . import test_holidays_flow
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_holidays_flow,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -20,8 +20,4 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from . import test_lunch
|
from . import test_lunch
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_lunch,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -21,13 +21,4 @@
|
||||||
|
|
||||||
from . import test_mail_group, test_mail_message, test_mail_features, test_mail_gateway, test_message_read, test_invite
|
from . import test_mail_group, test_mail_message, test_mail_features, test_mail_gateway, test_message_read, test_invite
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_mail_group,
|
|
||||||
test_mail_message,
|
|
||||||
test_mail_features,
|
|
||||||
test_mail_gateway,
|
|
||||||
test_message_read,
|
|
||||||
test_invite,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -19,8 +19,4 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from openerp.addons.mass_mailing.tests import test_mail
|
from . import test_mail
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_mail,
|
|
||||||
]
|
|
||||||
|
|
|
@ -20,8 +20,4 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from . import test_note
|
from . import test_note
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_note,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -1,7 +1 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# from . import test_adyen
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
# test_adyen,
|
|
||||||
]
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from openerp.addons.payment_buckaroo.tests import test_buckaroo
|
from . import test_buckaroo
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_buckaroo,
|
|
||||||
]
|
|
||||||
|
|
|
@ -1,7 +1 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# from . import test_ogone
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
# test_ogone,
|
|
||||||
]
|
|
||||||
|
|
|
@ -1,7 +1 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# from . import test_paypal
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
# test_paypal,
|
|
||||||
]
|
|
||||||
|
|
|
@ -20,8 +20,4 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from . import test_portal
|
from . import test_portal
|
||||||
|
|
||||||
checks = [
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
test_portal,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
||||||
|
|
|
@ -21,8 +21,4 @@
|
||||||
|
|
||||||
from . import test_access_rights
|
from . import test_access_rights
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_access_rights,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -21,8 +21,4 @@
|
||||||
|
|
||||||
from . import test_access_rights
|
from . import test_access_rights
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_access_rights,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -1,6 +1 @@
|
||||||
from . import test_uom, test_pricelist
|
from . import test_uom, test_pricelist
|
||||||
|
|
||||||
fast_suite = [
|
|
||||||
test_uom,
|
|
||||||
test_pricelist
|
|
||||||
]
|
|
||||||
|
|
|
@ -21,8 +21,4 @@
|
||||||
|
|
||||||
from . import test_project_flow
|
from . import test_project_flow
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_project_flow,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -19,10 +19,6 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from openerp.addons.resource.tests import test_resource
|
from . import test_resource
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_resource,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -21,8 +21,4 @@
|
||||||
|
|
||||||
from . import test_move_explode
|
from . import test_move_explode
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_move_explode,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from openerp.addons.stock.tests import test_stock_flow
|
from . import test_stock_flow
|
||||||
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_stock_flow,
|
|
||||||
]
|
|
||||||
|
|
|
@ -21,7 +21,3 @@
|
||||||
|
|
||||||
|
|
||||||
from . import test_survey
|
from . import test_survey
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_survey
|
|
||||||
]
|
|
||||||
|
|
|
@ -21,8 +21,4 @@
|
||||||
|
|
||||||
import test_controllers
|
import test_controllers
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_controllers,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -24,8 +24,16 @@ and ``__init__.py`` contains::
|
||||||
|
|
||||||
from . import test_foo, test_bar
|
from . import test_foo, test_bar
|
||||||
|
|
||||||
.. note:: test modules which are not imported from ``tests/__init__.py`` will
|
.. warning::
|
||||||
not be run
|
|
||||||
|
test modules which are not imported from ``tests/__init__.py`` will not be
|
||||||
|
run
|
||||||
|
|
||||||
|
.. versionchanged:: 8.0
|
||||||
|
|
||||||
|
previously, the test runner would only run modules added to two lists
|
||||||
|
``fast_suite`` and ``checks`` in ``tests/__init__.py``. In 8.0 it will
|
||||||
|
run all imported modules
|
||||||
|
|
||||||
The test runner will simply run any test case, as described in the official
|
The test runner will simply run any test case, as described in the official
|
||||||
`unittest documentation`_, but Odoo provides a number of utilities and helpers
|
`unittest documentation`_, but Odoo provides a number of utilities and helpers
|
||||||
|
@ -46,8 +54,8 @@ been installed, and not run right after the module installation:
|
||||||
.. autofunction:: openerp.tests.common.post_install
|
.. autofunction:: openerp.tests.common.post_install
|
||||||
|
|
||||||
The most common situation is to use
|
The most common situation is to use
|
||||||
:class:`~openerp.tests.common.TransactionCase` and test a property of a of a
|
:class:`~openerp.tests.common.TransactionCase` and test a property of a model
|
||||||
model in each method::
|
in each method::
|
||||||
|
|
||||||
class TestModelA(common.TransactionCase):
|
class TestModelA(common.TransactionCase):
|
||||||
def test_some_action(self):
|
def test_some_action(self):
|
||||||
|
@ -67,7 +75,7 @@ Tests are automatically run when installing or updating modules if
|
||||||
Odoo server.
|
Odoo server.
|
||||||
|
|
||||||
As of Odoo 8, running tests outside of the install/update cycle is not
|
As of Odoo 8, running tests outside of the install/update cycle is not
|
||||||
|
supported.
|
||||||
|
|
||||||
.. _unittest2: http://pypi.python.org/pypi/unittest2
|
.. _unittest2: http://pypi.python.org/pypi/unittest2
|
||||||
.. _unittest documentation: https://docs.python.org/2/library/unittest.html
|
.. _unittest documentation: https://docs.python.org/2/library/unittest.html
|
||||||
|
|
|
@ -1,6 +1,2 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from . import test_convert
|
from . import test_convert
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_convert
|
|
||||||
]
|
|
||||||
|
|
|
@ -2,12 +2,4 @@
|
||||||
|
|
||||||
from . import test_html, test_gbf
|
from . import test_html, test_gbf
|
||||||
|
|
||||||
fast_suite = [
|
|
||||||
]
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_html,
|
|
||||||
test_gbf,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
from . import test_inheritance, test_extension, test_delegation
|
from . import test_inheritance, test_extension, test_delegation
|
||||||
|
|
||||||
fast_suite = [
|
|
||||||
]
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_inheritance,
|
|
||||||
test_extension,
|
|
||||||
test_delegation,
|
|
||||||
]
|
|
||||||
|
|
|
@ -2,13 +2,4 @@
|
||||||
|
|
||||||
from . import test_export, test_import, test_load
|
from . import test_export, test_import, test_load
|
||||||
|
|
||||||
fast_suite = [
|
|
||||||
]
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_export,
|
|
||||||
test_import,
|
|
||||||
test_load,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -2,11 +2,4 @@
|
||||||
|
|
||||||
from . import test_inherit
|
from . import test_inherit
|
||||||
|
|
||||||
fast_suite = [
|
|
||||||
]
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_inherit,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -5,14 +5,3 @@ from . import test_new_fields
|
||||||
from . import test_onchange
|
from . import test_onchange
|
||||||
from . import test_field_conversions
|
from . import test_field_conversions
|
||||||
from . import test_attributes
|
from . import test_attributes
|
||||||
|
|
||||||
fast_suite = [
|
|
||||||
]
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_related,
|
|
||||||
test_new_fields,
|
|
||||||
test_onchange,
|
|
||||||
test_field_conversions,
|
|
||||||
test_attributes,
|
|
||||||
]
|
|
||||||
|
|
|
@ -2,11 +2,4 @@
|
||||||
|
|
||||||
from . import test_workflow
|
from . import test_workflow
|
||||||
|
|
||||||
fast_suite = [
|
|
||||||
]
|
|
||||||
|
|
||||||
checks = [
|
|
||||||
test_workflow,
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import imp
|
import imp
|
||||||
|
import importlib
|
||||||
|
import inspect
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -366,23 +368,26 @@ def adapt_version(version):
|
||||||
return version
|
return version
|
||||||
|
|
||||||
def get_test_modules(module):
|
def get_test_modules(module):
|
||||||
""" Return a list of module for the addons potentialy containing tests to
|
""" Return a list of module for the addons potentially containing tests to
|
||||||
feed unittest2.TestLoader.loadTestsFromModule() """
|
feed unittest2.TestLoader.loadTestsFromModule() """
|
||||||
# Try to import the module
|
# Try to import the module
|
||||||
module = 'openerp.addons.' + module + '.tests'
|
modpath = 'openerp.addons.' + module
|
||||||
try:
|
try:
|
||||||
__import__(module)
|
mod = importlib.import_module('.tests', modpath)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
# If module has no `tests` sub-module, no problem.
|
# If module has no `tests` sub-module, no problem.
|
||||||
if str(e) != 'No module named tests':
|
if str(e) != 'No module named tests':
|
||||||
_logger.exception('Can not `import %s`.', module)
|
_logger.exception('Can not `import %s`.', module)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
# include submodules too
|
if hasattr(mod, 'fast_suite') or hasattr(mod, 'checks'):
|
||||||
result = [mod_obj for name, mod_obj in sys.modules.iteritems()
|
_logger.warn(
|
||||||
if mod_obj # mod_obj can be None
|
"Found deprecated fast_suite or checks attribute in test module "
|
||||||
if name.startswith(module)
|
"%s. These have no effect in or after version 8.0.",
|
||||||
if re.search(r'test_\w+$', name)]
|
mod.__name__)
|
||||||
|
|
||||||
|
result = [mod_obj for name, mod_obj in inspect.getmembers(mod, inspect.ismodule)
|
||||||
|
if name.startswith('test_')]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# Use a custom stream object to log the test executions.
|
# Use a custom stream object to log the test executions.
|
||||||
|
|
Loading…
Reference in New Issue