def test_save_reservation_other_guest(service: UpdateReservationGuest, context: Context, house, reservation): service._reservations_repo = Mock(save=Mock( side_effect=RuntimeError('ERR'))) context.contact_id = 999 context.house = house context.source = reservation context.reservation = reservation result = service.save_reservation(context) assert is_successful(result) assert result.unwrap().reservation == reservation
def test_make_reservation_from_data_other_guest( service: UpdateReservationGuest, context: Context, house, reservation): context.contact_id = 999 context.house = house context.source = reservation result = service.make_reservation_from_data(context) assert is_successful(result) _reservation = result.unwrap().reservation assert _reservation.guest_name == 'TEST' assert _reservation.guest_surname == 'Some' assert _reservation.guest_email == '*****@*****.**' assert _reservation.guest_phone == '12345'