mirror of https://github.com/OCA/web.git
[FIX] web_m2x_options: fix test_ir_config_parameter
parent
e7e795ccdd
commit
31a5e8e947
|
@ -14,7 +14,5 @@ class IrConfigParameter(models.Model):
|
||||||
"web_m2x_options.m2o_dialog",
|
"web_m2x_options.m2o_dialog",
|
||||||
"web_m2x_options.field_limit_entries",
|
"web_m2x_options.field_limit_entries",
|
||||||
]
|
]
|
||||||
return {
|
values = self.sudo().search_read([["key", "in", opts]], ["key", "value"])
|
||||||
res["key"]: res["value"]
|
return {res["key"]: res["value"] for res in values}
|
||||||
for res in self.sudo().search_read([["key", "in", opts]], ["key", "value"])
|
|
||||||
}
|
|
||||||
|
|
|
@ -16,15 +16,13 @@ class TestIrConfigParameter(common.TransactionCase):
|
||||||
|
|
||||||
def test_web_m2x_options_key(self):
|
def test_web_m2x_options_key(self):
|
||||||
web_m2x_options = self.env["ir.config_parameter"].get_web_m2x_options()
|
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", web_m2x_options)
|
||||||
self.assertIn("web_m2x_options.limit", options)
|
self.assertNotIn("web_m2x_options.m2o_dialog_test", web_m2x_options)
|
||||||
self.assertNotIn("web_m2x_options.m2o_dialog_test", options)
|
|
||||||
|
|
||||||
def test_web_m2x_options_value(self):
|
def test_web_m2x_options_value(self):
|
||||||
web_m2x_options = self.env["ir.config_parameter"].get_web_m2x_options()
|
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(web_m2x_options["web_m2x_options.limit"], "10")
|
||||||
self.assertEqual(options["web_m2x_options.limit"], "10")
|
self.assertTrue(bool(web_m2x_options["web_m2x_options.create_edit"]))
|
||||||
self.assertTrue(bool(options["web_m2x_options.create_edit"]))
|
self.assertTrue(bool(web_m2x_options["web_m2x_options.create"]))
|
||||||
self.assertTrue(bool(options["web_m2x_options.create"]))
|
self.assertEqual(web_m2x_options["web_m2x_options.search_more"], "False")
|
||||||
self.assertEqual(options["web_m2x_options.search_more"], "False")
|
self.assertTrue(bool(web_m2x_options["web_m2x_options.m2o_dialog"]))
|
||||||
self.assertTrue(bool(options["web_m2x_options.m2o_dialog"]))
|
|
||||||
|
|
Loading…
Reference in New Issue