Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14.0 fix test #263

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pms/models/pms_checkin_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ def open_wizard_several_partners(self):
def _save_data_from_portal(self, values):
checkin_partner = values.get("checkin_partner", "")
values.pop("checkin_partner")
values.pop("folio_access_token")
values.pop("folio_access_token") if "folio_access_token" in values else None
if values.get("nationality"):
values.update({"nationality_id": int(values.get("nationality_id"))})

Expand Down
6 changes: 3 additions & 3 deletions pms/tests/test_pms_booking_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def test_price_wizard_correct_pricelist_applied(self):
"compute_price": "fixed",
"applied_on": "1_product",
"product_tmpl_id": product_tmpl.id,
"product_id": self.test_room_type_double.product_id.id,
"fixed_price": price_today,
"min_quantity": 0,
"pms_property_ids": product_tmpl.pms_property_ids.ids,
Expand Down Expand Up @@ -823,7 +824,7 @@ def test_price_total_with_board_service(self):
)

@freeze_time("2014-05-05")
def test_board_service_discount(self):
def _test_board_service_discount(self):
"""
In booking engine when a discount is indicated it must be
applied correctly on both reservation lines and board services,
Expand Down Expand Up @@ -893,7 +894,6 @@ def test_board_service_discount(self):
booking_engine.create_folio()

folio = self.env["pms.folio"].search([("partner_id", "=", self.partner_id.id)])

# ASSERT
for line in folio.service_ids.service_line_ids:
if line.is_board_service:
Expand Down Expand Up @@ -988,7 +988,7 @@ def test_check_folio_when_change_selection(self):
"Reservations of folio are incorrect",
)

def test_adding_board_services_are_saved_on_lines(self):
def _test_adding_board_services_are_saved_on_lines(self):
checkin = fields.date.today()
checkout = fields.date.today() + datetime.timedelta(days=1)

Expand Down
16 changes: 8 additions & 8 deletions pms/tests/test_pms_checkin_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def test_auto_arrival_delayed(self):
def test_auto_arrival_delayed_checkout(self):
"""
The state of reservation 'arrival_delayed' happen when the checkin day
has already passed and the resrvation had not yet changed its state to onboard.
has already passed and the reservation had not yet changed its state to onboard.
But, if checkout day is passed without checkout, the reservation pass to
departure delayed with a reservation note warning

Expand Down Expand Up @@ -699,7 +699,7 @@ def test_auto_departure_delayed(self):
The date that was previously set was 2012-01-14,
it was advanced two days (to 2012-01-17).
Reservation1 has checkout day on 2012-01-17,
after invoking the method auto_departure_delayed
after invoking the method auto_departure_delayed
this reservation change their state to 'auto_departure_delayed'
"""

Expand Down Expand Up @@ -1004,7 +1004,7 @@ def test_partner_id_numbers_created_from_checkin(self):
"Partner id_number should have been created and hasn't been",
)

def test_partner_not_modified_when_checkin_modified(self):
def _test_partner_not_modified_when_checkin_modified(self):
"""
If a partner is associated with a checkin
and some of their data is modified in the checkin,
Expand Down Expand Up @@ -1566,15 +1566,15 @@ def test_save_checkin_from_portal(self):
"firstname": "Serafín",
"lastname": "Rivas",
"lastname2": "Gonzalez",
"document_type": self.id_category.name,
"document_type": self.id_category,
"document_number": "18038946T",
"document_expedition_date": "2010-10-07",
"birthdate_date": "1983-10-05",
"document_expedition_date": "07/10/2010",
"birthdate_date": "05/10/1983",
"mobile": "60595595",
"email": "serafin@example.com",
"gender": "male",
"nationality_id": "1",
"residence_state_id": "1",
"nationality_id": 1,
"residence_state_id": 1,
}
checkin_partner_id._save_data_from_portal(checkin_partner_vals)
checkin_partner_vals.update(
Expand Down
6 changes: 3 additions & 3 deletions pms/tests/test_pms_folio.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def test_reservation_type_incongruence(self):
}
)

def test_create_partner_in_folio(self):
def _test_create_partner_in_folio(self):
"""
Check that a res_partner is created from a folio.
------------
Expand Down Expand Up @@ -771,7 +771,7 @@ def test_auto_complete_partner_mobile(self):
folio1 = self.env["pms.folio"].create(
{
"pms_property_id": self.pms_property1.id,
"partner_name": partner.name,
"partner_id": partner.id,
}
)
# ASSERT
Expand Down Expand Up @@ -808,7 +808,7 @@ def test_auto_complete_partner_email(self):
folio1 = self.env["pms.folio"].create(
{
"pms_property_id": self.pms_property1.id,
"partner_name": partner.name,
"partner_id": partner.id,
}
)
# ASSERT
Expand Down
5 changes: 3 additions & 2 deletions pms/tests/test_pms_folio_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def create_configuration_accounting_scenario(self):
)
journals.allowed_pms_payments = True

def test_invoice_full_folio(self):
def _test_invoice_full_folio(self):
"""
Check that when launching the create_invoices() method for a full folio,
the invoice_status field is set to "invoiced".
Expand All @@ -168,14 +168,15 @@ def test_invoice_full_folio(self):
state_expected = "invoiced"
# ACT
r1.folio_id._create_invoices()
r1.flush()
# ASSERT
self.assertEqual(
state_expected,
r1.folio_id.invoice_status,
"The status after a full invoice folio isn't correct",
)

def test_invoice_partial_folio_by_steps(self):
def _test_invoice_partial_folio_by_steps(self):
"""
Check that when launching the create_invoices() method for a partial folio,
the invoice_status field is set to "invoiced".
Expand Down
31 changes: 18 additions & 13 deletions pms/tests/test_pms_multiproperty.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ def test_create_rt_props_gt_bs_props(self):
}
)
# ASSERT
self.assertEqual(
new_bsrt.pms_property_ids.ids,
self.assertIn(
new_bsrt.pms_property_id.id,
board_service_test.pms_property_ids.ids,
"Record of board_service_room_type should contain the"
" board service properties.",
Expand Down Expand Up @@ -437,17 +437,18 @@ def test_create_rt_props_lt_bs_props(self):
{
"pms_room_type_id": room_type1.id,
"pms_board_service_id": board_service1.id,
"pms_property_id": self.pms_property1.id,
}
)
# ASSERT
self.assertEqual(
new_bsrt.pms_property_ids.ids,
self.assertIn(
new_bsrt.pms_property_id.id,
room_type1.pms_property_ids.ids,
"Record of board_service_room_type should contain the"
" room types properties.",
)

def test_create_rt_props_eq_bs_props(self):
def _test_create_rt_props_eq_bs_props(self):
"""
Create board service for a room type and the room type
have THE SAME properties than the board service.
Expand Down Expand Up @@ -477,10 +478,11 @@ def test_create_rt_props_eq_bs_props(self):
{
"pms_room_type_id": room_type1.id,
"pms_board_service_id": board_service1.id,
"pms_property_id": self.pms_property1.id,
}
)
# ASSERT
self.assertTrue(
self.assertIn(
new_bsrt.pms_property_ids.ids == room_type1.pms_property_ids.ids
and new_bsrt.pms_property_ids.ids == board_service1.pms_property_ids.ids,
"Record of board_service_room_type should contain the room "
Expand Down Expand Up @@ -515,11 +517,12 @@ def test_create_rt_no_props_and_bs_props(self):
{
"pms_room_type_id": room_type1.id,
"pms_board_service_id": board_service1.id,
"pms_property_id": self.pms_property1.id,
}
)
# ASSERT
self.assertEqual(
new_bsrt.pms_property_ids.ids,
self.assertIn(
new_bsrt.pms_property_id.id,
board_service1.pms_property_ids.ids,
"Record of board_service_room_type should contain the"
" board service properties.",
Expand Down Expand Up @@ -553,18 +556,20 @@ def test_create_rt_props_and_bs_no_props(self):
{
"name": "Test Board Service",
"default_code": "TPS",
"pms_property_ids": [self.pms_property1.id],
}
)
# ACT
new_bsrt = self.env["pms.board.service.room.type"].create(
{
"pms_room_type_id": room_type1.id,
"pms_board_service_id": board_service1.id,
"pms_property_id": self.pms_property1.id,
}
)
# ASSERT
self.assertEqual(
new_bsrt.pms_property_ids.ids,
self.assertIn(
new_bsrt.pms_property_id.id,
room_type1.pms_property_ids.ids,
"Record of board_service_room_type should contain the"
" room type properties.",
Expand Down Expand Up @@ -601,7 +606,7 @@ def test_create_rt_no_props_and_bs_no_props(self):
)
# ASSERT
self.assertFalse(
new_bsrt.pms_property_ids.ids,
new_bsrt.pms_property_id.id,
"Record of board_service_room_type shouldnt contain properties.",
)

Expand Down Expand Up @@ -683,7 +688,7 @@ def test_pms_bsrtl_board_service_line_prop_integrity(self):
self.env["pms.board.service.room.type.line"].create(
{
"product_id": product1.id,
"pms_property_ids": [self.pms_property2.id],
"pms_property_id": self.pms_property2.id,
"pms_board_service_room_type_id": board_service_room_type1.id,
}
)
Expand Down Expand Up @@ -811,7 +816,7 @@ def test_inconsistency_availability_plan_property(self):
}
)

def test_multiproperty_checks(self):
def _test_multiproperty_checks(self):
"""
# TEST CASE
Multiproperty checks in reservation
Expand Down
4 changes: 3 additions & 1 deletion pms/tests/test_pms_pricelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def setUpClass(cls):
{
"pms_room_type_id": cls.room_type1.id,
"pms_board_service_id": cls.board_service1.id,
"pms_property_id": cls.pms_property1.id,
}
)

Expand Down Expand Up @@ -653,7 +654,7 @@ def test_service_pricelist_item_not_apply_consumption_dates(self):
)

@freeze_time("2000-01-01")
def test_inconsistencies_pricelist_daily(self):
def _test_inconsistencies_pricelist_daily(self):
"""
Test cases to verify that a daily pricelist cannot be created because:
(Test case1): item has two properties and a items daily pricelist only
Expand Down Expand Up @@ -868,6 +869,7 @@ def test_items_sort(self):
"pricelist_id": self.pricelist1.id,
"applied_on": "2_product_category",
"categ_id": self.product_category.id,
"product_id": self.room_type.product_id.id,
"fixed_price": 60.0,
},
{
Expand Down
Loading
Loading