mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_widget_open_tab: Migration to 17.0
This commit is contained in:
1
web_widget_open_tab/tests/__init__.py
Normal file
1
web_widget_open_tab/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_main
|
||||
21
web_widget_open_tab/tests/test_main.py
Normal file
21
web_widget_open_tab/tests/test_main.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from odoo.tests import common
|
||||
|
||||
|
||||
class Test(common.TransactionCase):
|
||||
def test_add_open_tab_field(self):
|
||||
self.env["ir.model"]._get("res.company").add_open_tab_field = True
|
||||
arch, view = self.env["res.company"]._get_view(view_id=None, view_type="tree")
|
||||
found = arch.xpath("//field[@widget='open_tab']")
|
||||
self.assertEqual(len(found), 1)
|
||||
|
||||
def test_no_add_open_tab_field(self):
|
||||
self.env["ir.model"]._get("res.company").add_open_tab_field = False
|
||||
arch, view = self.env["res.company"]._get_view(view_id=None, view_type="tree")
|
||||
found = arch.xpath("//field[@widget='open_tab']")
|
||||
self.assertFalse(found)
|
||||
|
||||
def test_add_open_tab_field_no_name_field(self):
|
||||
self.env["ir.model"]._get("res.groups").add_open_tab_field = True
|
||||
arch, view = self.env["res.groups"]._get_view(view_id=None, view_type="tree")
|
||||
found = arch.xpath("//field[@widget='open_tab']")
|
||||
self.assertEqual(len(found), 1)
|
||||
Reference in New Issue
Block a user