-
部署odoo测试环境(windows下见这里 )
-
编码测试用例,如
foo -- tests -- __init__.py -- test_foo.py code in test_foo.py # -*- coding: utf-8 -*-. from openerp.tests.common import TransactionCase class MyTestCase(TransactionCase): def test_some_action(self): env = self.env['foo.ModelA'] records = env.search([]) for record in records: self.assertEqual(record.message, "test")
-
修改运行参数为:
-c <config file path> -d <default db name> --stop-after-init --log-level=test --test-enable -i <target module name> 例如:-c C:\odoo\openerp-server.conf -d odoo --stop-after-init --log-level=test --test-enable -i foo
-
Finish
转载于:https://my.oschina.net/gudaoxuri/blog/403425