mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD] multihotel room consistency and test cases
This commit is contained in:
@@ -22,6 +22,6 @@
|
||||
##############################################################################
|
||||
# from . import test_reservation
|
||||
# from . import test_folio
|
||||
# from . import test_hotel_room_model
|
||||
from . import test_inherited_ir_http
|
||||
from . import test_hotel_room_type
|
||||
from . import test_hotel_room
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
@@ -26,8 +25,29 @@ from odoo.exceptions import ValidationError
|
||||
|
||||
class TestHotelRoom(TestHotel):
|
||||
|
||||
def test_rooms_by_hotel(self):
|
||||
# A room cannot be created in a room type of another hotel
|
||||
with self.assertRaises(ValidationError):
|
||||
record = self.env['hotel.room'].sudo().create({
|
||||
'name': 'Test Room',
|
||||
'hotel_id': self.demo_hotel_property.id,
|
||||
'room_type_id': self.room_type_0.id,
|
||||
})
|
||||
# A room cannot be changed to another hotel
|
||||
with self.assertRaises(ValidationError):
|
||||
self.room_0.sudo().write({
|
||||
'hotel_id': self.demo_room_type_0.hotel_id.id
|
||||
})
|
||||
|
||||
def test_rooms_by_room_type(self):
|
||||
# A room cannot be changed to a room type of another hotel
|
||||
with self.assertRaises(ValidationError):
|
||||
self.room_0.sudo().write({
|
||||
'room_type_id': self.demo_room_type_1.id
|
||||
})
|
||||
|
||||
def test_check_capacity(self):
|
||||
# TODO Do the test using different users
|
||||
# The capacity of the room must be greater than 0
|
||||
with self.assertRaises(ValidationError):
|
||||
self.room_0.sudo().write({
|
||||
'capacity': 0
|
||||
Reference in New Issue
Block a user