我想在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