Odoo provides support for testing modules using unittest.
To write tests, simply define a tests sub-package in your module, it will be automatically inspected for test modules. Test modules should have a name starting with test_ and should be imported from tests/__init__.py,
Test_module
|-- ...
`-- tests
|-- __init__.py
|-- test_bar.py
`-- test_foo.py
and __init__.py contains:
from . import test_foo, test_bar
Note- test modules which are not imported from tests/__init__.py will not be run.
0 Comment(s)