[RFC]pms: update tests

This commit is contained in:
Darío Lodeiros
2022-07-23 18:48:16 +02:00
parent 8be5cf58b4
commit 1011868e8f
3 changed files with 20 additions and 13 deletions

View File

@@ -57,9 +57,13 @@ class TestPmsCheckinPartner(TestPms):
"gender": "male",
}
)
self.id_category = self.env["res.partner.id_category"].create(
{"name": "DNI", "code": "D"}
self.id_category = self.env["res.partner.id_category"].search(
[("code", "=", "D")]
)
if not self.id_category:
self.id_category = self.env["res.partner.id_category"].create(
{"name": "DNI", "code": "D"}
)
self.env["res.partner.id_number"].create(
{
"category_id": self.id_category.id,
@@ -1609,6 +1613,7 @@ class TestPmsCheckinPartner(TestPms):
"partner_id": self.host1.id,
"adults": 1,
"pms_property_id": self.pms_property1.id,
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
checkin_partner_id = self.reservation.checkin_partner_ids[0]

View File

@@ -84,6 +84,14 @@ class TestPmsFolioInvoice(TestPms):
}
)
# create a sale channel
self.sale_channel_direct1 = self.env["pms.sale.channel"].create(
{
"name": "Door",
"channel_type": "direct",
}
)
def create_configuration_accounting_scenario(self):
"""
Method to simplified scenario to payments and accounting:
@@ -135,14 +143,6 @@ class TestPmsFolioInvoice(TestPms):
)
journals.allowed_pms_payments = True
# create a sale channel
self.sale_channel_direct1 = self.env["pms.sale.channel"].create(
{
"name": "Door",
"channel_type": "direct",
}
)
def test_invoice_full_folio(self):
"""
Check that when launching the create_invoices() method for a full folio,
@@ -391,7 +391,6 @@ class TestPmsFolioInvoice(TestPms):
"adults": 2,
"room_type_id": self.room_type_double.id,
"partner_id": self.partner_id.id,
"service_ids": [(6, 0, [self.service1.id])],
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
@@ -435,7 +434,6 @@ class TestPmsFolioInvoice(TestPms):
"adults": 2,
"room_type_id": self.room_type_double.id,
"partner_id": self.partner_id.id,
"service_ids": [(6, 0, [self.service1.id])],
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
@@ -480,7 +478,6 @@ class TestPmsFolioInvoice(TestPms):
"adults": 2,
"room_type_id": self.room_type_double.id,
"partner_id": self.partner_id.id,
"service_ids": [(6, 0, [self.service1.id])],
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
@@ -697,6 +694,7 @@ class TestPmsFolioInvoice(TestPms):
"adults": 2,
"room_type_id": self.room_type_double.id,
"partner_id": self.partner_id.id,
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
@@ -728,6 +726,7 @@ class TestPmsFolioInvoice(TestPms):
"adults": 2,
"room_type_id": self.room_type_double.id,
"partner_id": self.partner_id.id,
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
@@ -799,6 +798,7 @@ class TestPmsFolioInvoice(TestPms):
"room_type_id": self.demo_room_type_double.id,
"partner_id": self.partner_id.id,
"board_service_room_id": self.board_service_room_type1.id,
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
self.service = self.env["pms.service"].create(
@@ -896,6 +896,7 @@ class TestPmsFolioInvoice(TestPms):
"room_type_id": self.room_type_double.id,
"partner_id": self.partner_id.id,
"board_service_room_id": self.board_service_room_type1.id,
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
self.service = self.env["pms.service"].create(

View File

@@ -3863,6 +3863,7 @@ class TestPmsReservations(TestPms):
"pms_property_id": self.pms_property1.id,
"reservation_type": "out",
"closure_reason_id": closure_reason,
"sale_channel_origin_id": self.sale_channel_direct.id,
}
)
# ASSERT