mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] add test to check if the value of product.product_pricelist_setting was modified or deleted
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user