diff --git a/pms/tests/test_pms_pricelist.py b/pms/tests/test_pms_pricelist.py index f1ed184d8..d10756319 100644 --- a/pms/tests/test_pms_pricelist.py +++ b/pms/tests/test_pms_pricelist.py @@ -1,3 +1,4 @@ +from odoo.exceptions import ValidationError from odoo.tests import common, tagged @@ -7,10 +8,32 @@ class TestPmsPricelist(common.TransactionCase): # ARRANGE key = "product.product_pricelist_setting" - value = "Advance" + value = "advanced" # ACT found_value = self.env["ir.config_parameter"].sudo().get_param(key) # ASSERT - self.assertEqual(found_value, value, "The register wasn't created") + self.assertEqual(found_value, value, "Parameter doesn't exist") + + def test_product_pricelist_setting_modified(self): + + # ARRANGE + key = "product.product_pricelist_setting" + value = "basic" + + # ACT & ASSERT + with self.assertRaises(ValidationError), self.cr.savepoint(): + self.env["ir.config_parameter"].set_param(key, value) + + def test_product_pricelist_setting_unlink(self): + + # ARRANGE + key = "product.product_pricelist_setting" + value = "advanced" + + # ACT & ASSERT + with self.assertRaises(ValidationError), self.cr.savepoint(): + self.env["ir.config_parameter"].search( + [("key", "=", key), ("value", "=", value)] + ).unlink()