mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Test_pms_sale_channel
This commit is contained in:
committed by
Darío Lodeiros
parent
c3c5ff059c
commit
ca2874bb3f
@@ -22,3 +22,4 @@
|
||||
from . import test_pms_reservation
|
||||
from . import test_pms_pricelist
|
||||
from . import test_pms_checkin_partner
|
||||
from . import test_pms_sale_channel
|
||||
|
||||
32
pms/tests/test_pms_sale_channel.py
Normal file
32
pms/tests/test_pms_sale_channel.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from .common import TestHotel
|
||||
from freezegun import freeze_time
|
||||
from odoo.exceptions import ValidationError
|
||||
import datetime
|
||||
from odoo import fields
|
||||
|
||||
@freeze_time("2010-01-01")
|
||||
class TestPmsSaleChannel(TestHotel):
|
||||
def test_reservation_indirect_channel(self):
|
||||
#ARRANGE
|
||||
PmsReservation = self.env["pms.reservation"]
|
||||
not_agency = self.env["res.partner"].create(
|
||||
{
|
||||
"name":"partner1",
|
||||
"is_agency":False
|
||||
}
|
||||
)
|
||||
|
||||
#ACT & ASSERT
|
||||
with self.assertRaises(ValidationError), self.cr.savepoint():
|
||||
PmsReservation.create(
|
||||
{
|
||||
"checkin": datetime.datetime.now(),
|
||||
"checkout":datetime.datetime.now() + datetime.timedelta(days=3),
|
||||
"channel_type":"indirect",
|
||||
"partner_id":not_agency.id
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user