mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
Merge branch '14.0' into 14.0-pms-minimize-split-rooms
This commit is contained in:
@@ -20,3 +20,4 @@
|
||||
#
|
||||
##############################################################################
|
||||
from . import test_pms_reservation
|
||||
from . import test_pms_pricelist
|
||||
|
||||
39
pms/tests/test_pms_pricelist.py
Normal file
39
pms/tests/test_pms_pricelist.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.tests import common, tagged
|
||||
|
||||
|
||||
@tagged("standard", "nice")
|
||||
class TestPmsPricelist(common.TransactionCase):
|
||||
def test_advanced_pricelist_exists(self):
|
||||
|
||||
# ARRANGE
|
||||
key = "product.product_pricelist_setting"
|
||||
value = "advanced"
|
||||
|
||||
# ACT
|
||||
found_value = self.env["ir.config_parameter"].sudo().get_param(key)
|
||||
|
||||
# ASSERT
|
||||
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()
|
||||
@@ -7,6 +7,7 @@ from odoo.exceptions import ValidationError
|
||||
|
||||
from .common import TestHotel
|
||||
|
||||
@freeze_time("2012-01-14")
|
||||
class TestPmsReservations(TestHotel):
|
||||
|
||||
def create_common_scenario(self):
|
||||
@@ -489,3 +490,22 @@ class TestPmsReservations(TestHotel):
|
||||
|
||||
with self.assertRaises(ValidationError):
|
||||
r_test.flush()
|
||||
|
||||
|
||||
def test_manage_children_raise(self):
|
||||
|
||||
# ARRANGE
|
||||
PmsReservation = self.env["pms.reservation"]
|
||||
|
||||
# ACT & ASSERT
|
||||
with self.assertRaises(ValidationError), self.cr.savepoint():
|
||||
|
||||
PmsReservation.create(
|
||||
{
|
||||
"adults": 2,
|
||||
"children_occupying": 1,
|
||||
"checkin": datetime.datetime.now(),
|
||||
"checkout": datetime.datetime.now() + datetime.timedelta(days=1),
|
||||
"room_type_id": self.browse_ref("pms.pms_room_type_0").id,
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user