我想在odoo 8中编写测试用例,但我无法运行测试用例。我的意思是没有任何反应,没有测试用例运行 我已经创建了一个模块,下面是我的代码。写单元测试odoo 8
__openerp__.py
{
'name': "wms_mobile",
'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",
'description': """
Long description of module's purpose
""",
'author': "Your Company",
'website': "http://www.yourcompany.com",
'category': 'Uncategorized',
'version': '0.2',
# any module necessary for this one to work correctly
'depends': ['web'],
# always loaded
'data': ['views/main_templates.xml'],
# only loaded in demonstration mode
'demo': [
'demo.xml',
],
}
和我有__init__.py测试文件夹和test_location.py __init__.py
# -*- coding: utf-8 -*-
from . import test_location
test_location.py
# -*- coding: utf-8 -*-
from openerp.tests.common import TransactionCase
class test_location(TransactionCase):
def setUp(self):
super(test_location, self).setUp()
self.LocationObj = self.env['stock.location']
def test_location(self):
record = self.LocationObj.search([('name','=','Stock')])
self.assertEqual(record.id,1)
我跑带有--test-enable参数的服务器,但是我看不到测试正在运行。
我是否缺少一些东西。
我的数据库也有条目。
请帮助
感谢,
由于Odoo 8它是'odoo.py' ;-) – CZoellner
感谢您指出...... openerp-server'仍然存在并仍然有效,但是在#!/ usr/bin/env python的机器上指向python3它不会。即使你可能需要做'python2 odoo.py' – danidee