+1 vote

Tests in installed module didn't run.I installed a module module_a from website, then I create the tests files in this module. The tests didn't run when I run python3 odoo-bin -c odoo.conf -d odoo12 --test-enable -u module_a.(Windows)here is the test file. It's imported by the tests__ini__.py

# -*- coding: utf-8 -*-
from odoo.tests.common import TransactionCase
from odoo.tests import tagged

class TestBook(TransactionCase):
    def test_create(self):
        "Create a simple Book Order"
        Todo = self.env["book.order"]
        task = Todo.create({"name": "test_order"})
        self.assertEqual(task.state, "draft")

Could you please give me some help?

in App by (10.5k points) | 161 views

1 Answer

0 votes

You have to add tag post_install for the test to run when upgrading.

class TestBook(TransactionCase):
by (8.8k points)
205 questions
180 answers
222,836 users