mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]pms_l10n_es: Fix tests adr&revpar
This commit is contained in:
@@ -690,7 +690,7 @@ class PmsProperty(models.Model):
|
||||
count_room_days_not_allowed = len(
|
||||
self.env["pms.reservation.line"].search(not_allowed_rooms_domain)
|
||||
)
|
||||
date_range_days = (end_date - start_date).days
|
||||
date_range_days = (end_date - start_date).days + 1
|
||||
count_total_room_days = len(self.room_ids) * date_range_days
|
||||
count_available_room_days = count_total_room_days - count_room_days_not_allowed
|
||||
if not sum_group_price[0]["price"]:
|
||||
|
||||
@@ -753,12 +753,19 @@ class TestWizardINE(TestPms):
|
||||
# ARRANGE
|
||||
self.ideal_scenario()
|
||||
start_date = datetime.date(2021, 2, 1)
|
||||
end_date = datetime.date(2021, 2, 28)
|
||||
expected_monthly_adr = 23.58
|
||||
|
||||
# ACT
|
||||
monthly_adr = self.env["pms.ine.wizard"].ine_calculate_monthly_adr(
|
||||
start_date, self.pms_property1.id
|
||||
wizard = self.env["pms.ine.wizard"].new(
|
||||
{
|
||||
"pms_property_id": self.pms_property1.id,
|
||||
"start_date": start_date,
|
||||
"end_date": end_date,
|
||||
}
|
||||
)
|
||||
|
||||
monthly_adr = wizard.ine_calculate_adr(start_date, end_date)
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_monthly_adr,
|
||||
@@ -784,12 +791,18 @@ class TestWizardINE(TestPms):
|
||||
# ARRANGE
|
||||
self.ideal_scenario()
|
||||
start_date = datetime.date(2021, 2, 1)
|
||||
end_date = datetime.date(2021, 2, 28)
|
||||
expected_monthly_revpar = 0.99
|
||||
|
||||
# ACT
|
||||
monthly_revpar = self.env["pms.ine.wizard"].ine_calculate_monthly_revpar(
|
||||
start_date, self.pms_property1.id
|
||||
wizard = self.env["pms.ine.wizard"].new(
|
||||
{
|
||||
"pms_property_id": self.pms_property1.id,
|
||||
"start_date": start_date,
|
||||
"end_date": end_date,
|
||||
}
|
||||
)
|
||||
monthly_revpar = wizard.ine_calculate_revpar(start_date, end_date)
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_monthly_revpar,
|
||||
|
||||
Reference in New Issue
Block a user