Я пытаюсь написать тест для модуля odoo.
Модуль имеет структуру:
/pr_mobile
|--->conttrollers
|--->demo
|--->models
|--->security
|--->tests
....|----> __init__.py
....|----> test_mobileproduct.py
|--->views
__init__.py
...
* INIT 1005 * .py:
from . import tests
Тесты / 1010 * INIT * .py
import test_mobileproduct
Тесты / test_mobileproduct.py
# -*- coding: utf-8 -*-
import unittest
from openerp.tests import common
from openerp.exceptions import ValidationError
class TestMobileProduct(common.TransactionCase):
def test_get_maket(self):
self.assertEqual(1, 2)
def test_get_maket2(self):
self.assertEqual(1, 2)
def test_get_maket3(self):
self.assertEqual(1, 2)
def test_get_maket4(self):
self.assertEqual5(1, 2)
if __name__ == '__main__':
unittest.main()
Я запускаю тест с этими командами:
. / Odoo.py --addons-path = addons, openerp / addons, openerp / my-addons -d
pr_odoo_v9 --db-filter = "^ pr_odoo_v9" -u pr_mobile --test-enable
--log-уровень = тест
И результат:
skif@ubuntu-desktop:/opt/odoo$ ./odoo.py --addons-path=addons,openerp/addons,openerp/my-addons -d pr_odoo_v9 --db-filter="^pr_odoo_v9" -u pr_mobile --test-enable --log-level=test
2019-04-10 15:11:48,708 8919 INFO ? openerp: OpenERP version 9.0c
2019-04-10 15:11:48,709 8919 INFO ? openerp: addons paths: ['/home/skif/.local/share/Odoo/addons/9.0', u'/opt/odoo/addons', u'/opt/odoo/openerp/addons', u'/opt/odoo/openerp/my-addons']
2019-04-10 15:11:48,709 8919 INFO ? openerp: database: default@default:default
2019-04-10 15:11:48,774 8919 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
2019-04-10 15:11:48,780 8919 INFO pr_odoo_v9 openerp.modules.loading: loading 1 modules...
2019-04-10 15:11:48,788 8919 INFO pr_odoo_v9 openerp.modules.loading: 1 modules loaded in 0.01s, 0 queries
2019-04-10 15:11:49,541 8919 INFO pr_odoo_v9 openerp.modules.loading: loading 64 modules...
2019-04-10 15:11:49,560 8919 INFO ? openerp.addons.bus.models.bus: Bus.loop listen imbus on db postgres
2019-04-10 15:11:49,579 8919 INFO pr_odoo_v9 openerp.addons.report.models.report: You need Wkhtmltopdf to print a pdf version of the reports.
2019-04-10 15:11:50,252 8919 INFO pr_odoo_v9 openerp.modules.module: module pr_mobile: creating or updating database tables
/opt/odoo/openerp/models.py:451: UnicodeWarning: Unicode unequal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if cols[k][key] != vals[key]:
2019-04-10 15:11:50,601 8919 INFO pr_odoo_v9 openerp.modules.loading: loading pr_mobile/views/views.xml
2019-04-10 15:11:50,970 8919 INFO pr_odoo_v9 openerp.modules.loading: loading pr_mobile/views/saleorder.xml
2019-04-10 15:11:51,017 8919 INFO pr_odoo_v9 openerp.modules.loading: loading pr_mobile/views/templates.xml
2019-04-10 15:11:51,021 8919 INFO pr_odoo_v9 openerp.addons.base.ir.ir_translation: module pr_mobile: no translation for language ru
2019-04-10 15:11:51,171 8919 INFO pr_odoo_v9 openerp.modules.loading: 64 modules loaded in 1.63s, 5 queries
2019-04-10 15:11:51,626 8919 INFO pr_odoo_v9 openerp.modules.loading: Modules loaded.
2019-04-10 15:11:51,628 8919 INFO pr_odoo_v9 openerp.modules.loading: All post-tested in 0.00s, 0 queries
Почему тесты не работают? В БД представлены данные с рабочего сервера.