mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] Migrate the module web_m2x_options to v14.
This commit is contained in:
30
web_m2x_options/tests/test_ir_config_parameter.py
Normal file
30
web_m2x_options/tests/test_ir_config_parameter.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Copyright 2020 initOS GmbH.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo.tests import common
|
||||
|
||||
|
||||
class TestIrConfigParameter(common.SavepointCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(TestIrConfigParameter, cls).setUpClass()
|
||||
cls.env["ir.config_parameter"].set_param("web_m2x_options.limit", 10)
|
||||
cls.env["ir.config_parameter"].set_param("web_m2x_options.create_edit", "True")
|
||||
cls.env["ir.config_parameter"].set_param("web_m2x_options.create", "True")
|
||||
cls.env["ir.config_parameter"].set_param("web_m2x_options.search_more", "False")
|
||||
cls.env["ir.config_parameter"].set_param("web_m2x_options.m2o_dialog", "True")
|
||||
|
||||
def test_web_m2x_options_key(self):
|
||||
web_m2x_options = self.env["ir.config_parameter"].get_web_m2x_options()
|
||||
options = {opt["key"]: opt["value"] for opt in web_m2x_options}
|
||||
self.assertIn("web_m2x_options.limit", options)
|
||||
self.assertNotIn("web_m2x_options.m2o_dialog_test", options)
|
||||
|
||||
def test_web_m2x_options_value(self):
|
||||
web_m2x_options = self.env["ir.config_parameter"].get_web_m2x_options()
|
||||
options = {opt["key"]: opt["value"] for opt in web_m2x_options}
|
||||
self.assertEqual(options["web_m2x_options.limit"], "10")
|
||||
self.assertTrue(bool(options["web_m2x_options.create_edit"]))
|
||||
self.assertTrue(bool(options["web_m2x_options.create"]))
|
||||
self.assertEqual(options["web_m2x_options.search_more"], "False")
|
||||
self.assertTrue(bool(options["web_m2x_options.m2o_dialog"]))
|
||||
Reference in New Issue
Block a user