Skip to content

Commit

Permalink
[FIX] base_comment_template: Fix tests: test_company_general_template
Browse files Browse the repository at this point in the history
  • Loading branch information
victoralmau authored and alan196 committed May 3, 2024
1 parent 0d8cdef commit 6c63370
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions base_comment_template/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Carlos Roca
* Víctor Martínez
9 changes: 6 additions & 3 deletions base_comment_template/tests/test_base_comment_template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2020 NextERP Romania SRL
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from lxml import etree

Expand All @@ -15,19 +16,20 @@ class TestCommentTemplate(common.SavepointCase):
def setUpClass(cls):
super().setUpClass()
setup_test_model(cls.env, ResUsers)
cls.user_obj = cls.env["ir.model"].search([("model", "=", "res.users")])

cls.user_obj = cls.env.ref("base.model_res_users")
cls.user = cls.env.ref("base.user_demo")
cls.user2 = cls.env.ref("base.demo_user0")
cls.partner_id = cls.env.ref("base.res_partner_12")
cls.partner2_id = cls.env.ref("base.res_partner_10")
cls.company = cls.env["res.company"].search([], limit=1)
cls.main_company = cls.env.ref("base.main_company")
cls.company = cls.env["res.company"].create({"name": "Test company"})
cls.before_template_id = cls.env["base.comment.template"].create(
{
"name": "before_lines",
"text": "Text before lines",
"model_ids": [(6, 0, cls.user_obj.ids)],
"priority": 5,
"company_id": cls.main_company.id,
}
)
cls.after_template_id = cls.env["base.comment.template"].create(
Expand All @@ -37,6 +39,7 @@ def setUpClass(cls):
"text": "Text after lines",
"model_ids": [(6, 0, cls.user_obj.ids)],
"priority": 6,
"company_id": cls.main_company.id,
}
)

Expand Down

0 comments on commit 6c63370

Please sign in to comment.