# pylint: disable=too-many-public-methods

from risc_generator import FPQ1Contract
from risc_generator.content.en.endorsements.endorsement_header import generate_endorsement_page_header_text
from tests.domain.contract.contract_base import ContractTestBase


class EndorsementENTextTest(ContractTestBase):
    def setUp(self) -> None:
        self.fpq1_contract = FPQ1Contract(
            client_number=self.a_client_number,
            contract_start_date=self.a_contract_start_date,
            insuree=self.a_insuree,
            vehicle=self.a_vehicle,
            payment_method=self.a_pre_authorize_payment_method,
            protections=self.a_protections,
            premium=self.a_premium_mock,
            financing=self.a_creditor,
            locale=self.a_en_locale,
        )

    def test_endorsement_page_header_text(self):
        actual = generate_endorsement_page_header_text()

        expected = "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"

        self.assertEqual(expected, actual)

    def test_faq5a_text(self):
        actual = self.fpq1_contract.generate_faq5a_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 5a\n"
            "Vehicles leased or under a contact of leasing Changes\n"
            "when owner and one lessee are mentioned as insureds\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement changes the insurance contract:\n"
            "\t when the specified vehicle leased or under a contract of leasing; and\n"
            "\t when the owner and one lessee of the vehicle are mentioned as insureds under the insurance contract.\n"
            "The expression ''named insured'' will then be replaced by ''named lessee'' in the definition of the "
            "following\n"
            "''insured vehicles'':\n"
            "\t Vehicle of which the named insured has recently become the owner.\n"
            "\t Temporary substitute vehicle.\n"
            "\t Vehicle of which the named insured is not the owner.\n"
            "\t Trailer or semi-trailer of which the named insured is the owner.\n"
            "\t Trailer or semi-trailer of which the named insured is not the owner and that is used "
            "in connection with a vehicle insured under the insurance contract.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq16_text(self):
        actual = self.fpq1_contract.generate_faq16_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 16\n"
            "Suspension of coverage during vehicle storage\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract. "
            "Details required for the endorsement may be entered in the ''Declarations'' section or in "
            "the endorsement itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N: \n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Date of storage:  at 12:01 A.M. standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement suspends certain coverage under the insurance contract due "
            "to storage of the specified vehicle.\n"
            "Suspension of coverage\n"
            "The named insured declares that the specified vehicle will be withdrawn from use "
            "and stored as of the date of storage and therefore requests that the following coverage "
            "be suspended from that date:\n"
            "1. Suspended coverage under Section A\n"
            "Coverage under Section A of the insurance contract is suspended with regard to the "
            "driving or use of the following vehicles:\n"
            "\t specified vehicle;\n"
            "\t any vehicle of which the named insured has recently become the owner that "
            "replaces or is in addition to the specified vehicle;\n"
            "\t any temporary substitute vehicle that replaces the specified vehicle.\n"
            "The named insured will continue to benefit from the other coverage under Section A.\n"
            "2. Suspended coverage under Section B\n"
            "Coverage under Protections 1 and 2, Section B of the insurance contract is suspended "
            "with regard to the driving or use of the following vehicles:\n"
            "\t specified vehicle;\n"
            "\t any vehicle of which the named insured has recently become the owner that "
            "replaces or is in addition to the specified vehicle;\n"
            "\t any temporary substitute vehicle that replaces the specified vehicle.\n"
            "The named insured will continue to benefit from the other coverage under Section B.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "End of suspension of coverage\n"
            "The suspended coverage will be reinstated on one of the following dates:\n"
            "\t on the date determined by the named insured, if he or she has first informed the "
            "insurer accordingly;\n"
            "\t if no date has thus been determined, on the April 1st following the date of storage.\n"
            "The insurance contract must be in force for coverage to be reinstated.\n"
            "Rebate\n"
            "The named insured is entitled to a rebate for the storage period, calculated on the following basis:"
            "\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq20a_text(self):
        actual = self.fpq1_contract.generate_faq20a_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 20a\n"
            "Travel costs (broad form)\n"
            "(Section B)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer:  \n"
            "Named insured:  \n"
            "Endorsement to automobile insurance policy N:  \n"
            "Effective date: This endorsement will apply from at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement extends coverage under Section B of the insurance contract by replacing the "
            "wording of Article 4.1, ''Travel costs due to theft of insured vehicle'' with the wording below.\n"
            "This endorsement will apply only to the specified vehicle and only if the value of damage to "
            "the specified vehicle is greater than the deductible amount applicable to the loss "
            "that caused the damage.\n"
            "''4.1 Travel costs\n"
            "4.1.1 Description of travel costs\n"
            "If the named insured is no longer able to use the insured vehicle due to a covered loss, "
            "the insurer will reimburse expenses incurred for\n"
            "\t public transportation;\n"
            "\t leasing of a temporary replacement vehicle;\n"
            "\t taxicab fares.\n"
            "Upon submission of receipts, payment for the above expenses will be made up to a maximum of  $ a "
            "day and  $ per loss for each insured vehicle.\n"
            "The above amounts cannot be less than the amounts that were entered in Additional "
            "coverages 4.1, of the insurance contract.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "4.1.2 Application of coverage\n"
            "If the entire insured vehicle was stolen, this coverage will apply only to expenses incurred "
            "from 12:01 A.M. the day after the theft is reported to the police or to the insurer.\n"
            "For all other covered losses, this coverage will apply only to expenses incurred from the "
            "time at which the insured vehicle:\n"
            "\t can no longer be operated under its own power due to damage to the vehicle; or\n"
            "\t is delivered for repair, if it can still be operated in spite of damage to the vehicle.\n"
            "Expenses will be eligible for reimbursement even if the insurance contract has expired since "
            "the loss.\n"
            "Expenses will no longer be eligible for reimbursement once\n"
            "\t the insured vehicle has been replaced or repaired; or\n"
            "\t a settlement agreement for the loss has been reached before the insured vehicle "
            "is replaced or repaired.''\n"
            "4.1.3 Additional costs covered during a trip\n"
            "When a covered loss occurs during a trip, the expenses described in paragraphs "
            "(a) and (b) below will be covered, in addition to the expenses listed in paragraph 4.1.1.\n"
            "The expenses will be covered up to a maximum of  % of the maximum amount payable "
            "per loss shown in paragraph 4.1.1.\n"
            "(a) Any additional travel expenses incurred by the named insured, his or her spouse "
            "or any other person whose domicile is the same as theirs, to:\n"
            "\t continue the trip;\n"
            "\t return to the domicile of the named insured;\n"
            "\t return to where the insured vehicle is usually parked.\n"
            "Additional expenses include the cost of meals and accommodation and the cost "
            "of transportation of personal effects.\n"
            "(b) Any other additional expenses similar to those described in paragraph (a), "
            "incurred to retrieve the insured vehicle where it was repaired and return it to one "
            "of the following places:\n"
            "\t the current location of the named insured, his or her spouse or any "
            "other person whose domicile is the same as theirs. However, if that location is "
            "further away than the travel destination that had been planned before the loss, "
            "only the expenses required to return the insured vehicle to the planned destination "
            "are covered;\n"
            "\t the domicile of the named insured; or\n"
            "\t the place where the insured vehicle is usually parked.\n"
            "The expenses must have been incurred by the named insured, his or her "
            "spouse and any other person whose domicile is the same as theirs or any person of "
            "their choice.''\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq20_text(self):
        actual = self.fpq1_contract.generate_faq20_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 20\n"
            "Travel expenses\n"
            "(Section B)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer:  \n"
            "Named insured:  \n"
            "Endorsement to automobile insurance policy N:  \n"
            "Effective date: This endorsement will apply from at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Additional insurance premium payable:\n"
            "\t Amount payable:  \n"
            "\t Due date:  \n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement extends coverage under Section B of the insurance contract by replacing "
            "the wording of Article 4.1, ''Travel expenses due to theft of insured vehicle'' with "
            "the wording below.\n"
            "This endorsement will apply only to the specified vehicle and only if the value of "
            "damage to the specified vehicle is greater than the deductible amount applicable "
            "to the loss that caused the damage.\n"
            "''4.1 Travel expenses\n"
            "4.1.1 Description of travel expenses\n"
            "If the named insured is no longer able to use the insured vehicle due to a covered loss, "
            "the insurer will reimburse any expenses incurred for\n"
            "\t leasing of a temporary replacement vehicle;\n"
            "\t public transportation;\n"
            "\t use of taxicab.\n"
            "Upon submission of receipts, payment for the above expenses will be made up to a "
            "maximum of  $ a day and  $ per loss for each insured vehicle.\n"
            "The above amounts cannot be less than the amounts that were specified in "
            "Additional coverages 4.1, of the insurance contract.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "4.1.2 Application of coverage\n"
            "If the entire insured vehicle was stolen, this coverage will apply only to expenses incurred "
            "from 12:01 A.M. the day after the theft is reported to the police or to the insurer.\n"
            "For all other covered losses, this coverage will apply only to expenses incurred:\n"
            "\t from the time at which the insured vehicle can no longer be operated under its own "
            "power due to damage to the vehicle; or\n"
            "\t from the time at which the insured vehicle is delivered for repair, if it can still "
            "be operated in spite of damage to the vehicle.\n"
            "Expenses will be eligible for reimbursement even if the insurance contract has expired "
            "since the loss.\n"
            "Expenses will no longer be eligible for reimbursement once :\n"
            "\t the insured vehicle has been replaced or repaired; or\n"
            "\t a settlement agreement for the loss has been reached before the insured "
            "vehicle is replaced or repaired.''\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq23a_text(self):
        actual = self.fpq1_contract.generate_faq23a_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 23a\n"
            "Notice to creditor\n"
            "(Section B)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Name of creditor:  \n"
            "Address of creditor:  \n"
            "Endorsement to automobile insurance policy N: \n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement changes Section B of the insurance contract by adding the following obligation:\n"
            "\t The insurer must give the creditor notice at least 15 days before cancelling or "
            "changing any coverage under Section B.\n"
            "\t The insurer is required to do so only if cancelling or changing the coverage is "
            "prejudicial to the creditor.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq25_text(self):
        actual = self.fpq1_contract.generate_faq25_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 25\n"
            "Changes to the Declarations\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N: \n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "This endorsement may not be used in any way to change the standard wording of the "
            "insurance contract approved by the Autorité des marchés financiers.\n"
            "Endorsement description\n"
            "This endorsement makes the following changes to the details entered in the ''Declarations'' "
            "section of the insurance contract\n"
            "\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq31_text(self):
        actual = self.fpq1_contract.generate_faq31_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 31\n"
            "Equipment not owned by the named insured\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N: \n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement extends coverage under the insurance contract to the following "
            "equipment not owned by the named insured:\n"
            "Application\n"
            "The equipment must be normally attached to the specified vehicle. In addition, "
            "the named insured must have the care, custody or control of such equipment.\n"
            "1. Section A\n"
            "Coverage under Section A is extended to the financial consequences that an "
            "insured person may incur if held civilly liable for damage caused to another person "
            "and resulting from the equipment described above.\n"
            "2. Section B\n"
            "Coverage under Section B as applicable to the specified vehicle is extended to:\n"
            "\t direct and accidental damage caused to the equipment described above;\n"
            "\t the disappearance of such equipment.\n"
            "For Section B, the indemnity will be payable up to the ''actual cash value'' of the "
            "equipment, subject to a maximum of   $ Payment will be made jointly to the named "
            "insured and  , to the extent of their respective interests.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq41_text(self):
        actual = self.fpq1_contract.generate_faq41_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 41\n"
            "Change to deductibles\n"
            "(Section B)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N: \n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement makes the following changes to the deductible amounts under Section "
            "B, as entered in Item 4, ''Declarations'' of the insurance contract:\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq43_text(self):
        actual = self.fpq1_contract.generate_faq43_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 43 (A to F)\n"
            "Change to indemnity\n"
            "(Section B)\n"
            "The endorsement heading and the applicable options must be entered in the ''Declarations'' section of "
            "the insurance contract. Details required for the endorsement may be entered in the ''Declarations'' "
            "section or in the endorsement itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N: \n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Additional insurance premium payable:\n"
            "\t Amounts payable:  \n"
            "\t Due date:\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement extends coverage under Section B of the insurance contract by "
            "changing, depending on the applicable options, Article 2, ''Reporting a loss and "
            "submitting a claim.'' Changes made by these options relate to how the value of damage is calculated.\n"
            "APPLICATION OF ENDORSEMENT\n"
            "For the options to apply to the specified vehicle, they must be entered in the "
            "''Declarations'' section of the insurance contract.\n"
            "Except for Option 43C, the named insured may elect settlement in accordance "
            "with Article 2, ''Reporting a loss and submitting a claim'', without the selected "
            "option being applied. In such instance, the named insured must submit a request to the insurer.\n"
            "The deductible entered in the ''Declarations'' section for the specified vehicle will "
            "be assumed by the named insured.\n"
            "VALUE OF DAMAGE IN EVENT OF PARTIAL LOSS\n"
            "Options 43A and 43B relate to calculation of the value of damage payable by the "
            "insurer in the event of repair or replacement of damaged parts.\n"
            "These options change Article 2.1, ''Reporting a loss and submitting a claim.'' However, "
            "the rules set out in the first paragraph of Article 2.1.1 of that section continue to apply.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Option 43A – Partial loss – New parts\n"
            "In the event of partial loss, when the damaged parts can be repaired, the value of "
            "damage will be calculated in accordance with Article 2.1, ''Reporting a loss and "
            "submitting a claim.'' However, there will be no deduction for depreciation.\n"
            "If the insurer determines that damaged parts cannot be repaired and must be "
            "replaced, there will be no deduction for depreciation. In addition:\n"
            "\t the value of damage will be calculated on the basis of the cost of new "
            "original equipment manufacturer parts;\n"
            "\t if glass is damaged, the named insured may ask for it to be replaced by a new "
            "original equipment manufacturer part or by a new similar part.\n"
            "If a new part is out of stock or no longer being manufactured, the liability of the insurer will be "
            "limited to the latest list price of the new original equipment manufacturer part.\n"
            "If the damaged parts are not repaired or replaced by new parts, Option 43A will not apply.\n"
            "Option 43B – Partial loss – Waiver of depreciation\n"
            "In the event of partial loss, the value of damage will be calculated in accordance with Article 2.1, "
            "''Reporting a loss and submitting a claim.'' However, if the insurer determines that "
            "depreciation is to be applied to the value of damage, this option will cover "
            "such depreciation up to a maximum of   $ per loss.\n"
            "However, if the damaged parts are not repaired or replaced, Option 43B will not apply.\n"
            "VALUE OF DAMAGE IN EVENT OF TOTAL LOSS OR TOTAL CONSTRUCTIVE LOSS\n"
            "Options 43C, 43D, 43E and 43F relate to calculation of the value of "
            "damage payable by the insurer in the event of total loss or total constructive loss. "
            "They amend Article 2.2, ''Reporting a loss and submitting a claim.''\n"
            "Option 43C – Total loss – Value of vehicle agreed in advance\n"
            "In the event of total loss or total constructive loss, the named insured and the insurer "
            "agree that the value of the specified vehicle, on the date of the loss, will be:  $ (''agreed value'').\n"
            "Option43D – Total loss – Waiver of depreciation\n"
            "In the event of total loss or total constructive loss, the value of damage "
            "will be equal to the least of the following amounts:\n"
            "\t the price paid for the specified vehicle by the named insured who is the actual owner;\n"
            "\t the current price of the specified vehicle on the original date of purchase; or\n"
            "\t the price for which the insurer may, on the date of the loss, purchase a new "
            "vehicle with specifications or equipment and accessories similar to those of the specified vehicle.\n"
            "Option 43E – Total loss – Replacement cost\n"
            "In the event of total loss or total constructive loss, the named insured may choose one "
            "of the following three indemnity options:\n"
            "1. Replacement by a new vehicle\n"
            "If the specified vehicle is replaced by a new vehicle with the "
            "same specifications or equipment and accessories, the value of damage will be equal to the "
            "price of this vehicle.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            f"If no such vehicle is available and the specified vehicle is replaced by a "
            f"new vehicle with similar specifications or equipment and accessories, the value of damage "
            f"will be equal to the price of this vehicle.\n"
            f"2. Replacement by a used vehicle, or by a new vehicle other than as in paragraph 1\n"
            f"If the specified vehicle is replaced by a used vehicle, or by a new vehicle other than as in "
            f"paragraph 1, the value of damage will be equal to:\n"
            f"\t the price paid for the specified vehicle by the named insured who is the actual "
            f"owner; or\n"
            f"\t the price of the used or new vehicle that replaces the specified vehicle; whichever is higher.\n"
            f"However, the value of damage may not be greater than the price that the "
            f"insurer would have paid had paragraph 1 applied.\n"
            f"3. Non-replacement of specified vehicle\n"
            f"If the specified vehicle is not replaced, the value of damage will be equal to:\n"
            f"\t the price paid for the specified vehicle by the named insured who is the actual "
            f"owner; or\n"
            f"\t the current price of the specified vehicle on the original date of "
            f"purchase, whichever is lower.\n"
            f"However, the value of damage may not be greater than the price that the insurer "
            f"would have paid had paragraph 1 applied.\n"
            f"Option 43F – Total loss – Increased settlement\n"
            f"In the event of total loss or total constructive loss, the value of damage will be equal to:\n"
            f"\t A – the price paid for the specified vehicle by the named insured who is the actual owner, "
            f"increased by  % compounded annually and calculated "
            f"proportionally to the number of days elapsed between   (date) and the date of the loss;\n"
            f"or\n"
            f"B – the amount of  $ increased by  "
            f"compounded annually and calculated proportionally to the number of days elapsed "
            f"between  (date) and the date of the loss;\n"
            f"or\n"
            f"C – the ''actual cash value'' of the specified vehicle increased by  % "
            f"compounded annually and calculated proportionally to the number of days elapsed between "
            f" (date) and the date of the loss;\n"
            f"or\n"
            f"D – the ''actual cash value'' of the specified vehicle increased by  $.\n"
            f"In all instances, the value of damage may not be greater than the price for which "
            f"the insurer may, on the date of the loss, purchase a new vehicle with specifications, "
            f"equipment and accessories similar to those of the specified vehicle.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "SPECIFIC RULE FOR VEHICLE LEASED OR UNDER A CONTRACT OF LEASING\n"
            "If the specified vehicle is leased or under a contact of leasing, and if Option 43D, 43E or "
            "43F applies and the owner and lessee are designated in the insurance contract, only the "
            "lessee will be entitled to the difference between:\n"
            "\t the value of the specified vehicle, as calculated in accordance with the applicable option; and\n"
            "\t the ''actual cash value'' of the specified vehicle, as calculated in accordance "
            "with Article 2.2, ''Reporting a loss and submitting a claim.''\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq19_text(self):
        actual = self.fpq1_contract.generate_faq19_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 19\n"
            "Limitation of indemnity\n"
            "(Section B)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement limits the indemnity payable under Section B of the insurance contract to the "
            "lesser of the following amounts:\n"
            "\t the ''actual cash value'' of the specified vehicle; or\n"
            "\t  $.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq9_text(self):
        actual = self.fpq1_contract.generate_faq9_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 9\n"
            "Marine risk exclusion for amphibious vehicles\n"
            "Modifications\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "An amphibious vehicle is a vehicle designed or modified to:\n"
            "\t travel on land, and\n"
            "\t be used in or upon water\n"
            "If the specified vehicle is an amphibious vehicle, this endorsement excludes "
            "coverage under the insurance contract for loss occurring while it is used in or "
            "upon water or while it is being launched into or landed therefrom.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq8_text(self):
        actual = self.fpq1_contract.generate_faq8_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 8\n"
            "Deductible for property damage\n"
            "(Section A)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement changes Section A of the insurance contract by adding a deductible "
            "for property damage caused by the specified vehicle:\n"
            "\t A maximum deductible amount of  $ per loss.\n"
            "\t A maximum deductible amount of  $ per loss, when the vehicle is used to  .\n"
            "Agreement by named insured\n"
            "When the insurer pays an indemnity for property damage, the named insured agrees to reimburse "
            "the insurer for up to the deductible amount.\n"
            "Reimbursement must be made by the named insured as soon as the insurer pays the indemnity.\n"
            "Rights of insurer\n"
            "In respect of the deductible, the insurer will be entitled to:\n"
            "\t act as it wishes with regard to any investigation, transaction or settlement;\n"
            "\t authorize the named insured to enter into a transaction or a settlement with another "
            "person that has suffered property damage and indemnify that person. However, the total "
            "amount agreed upon further to the transaction or settlement must not exceed the deductible amount.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq30_text(self):
        actual = self.fpq1_contract.generate_faq30_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 30\n"
            "Limitation of coverage for equipment and machinery attached to vehicle\n"
            "(Section A)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "Subject to the Automobile Insurance Act, this endorsement limits coverage "
            "under Section A of the insurance contract by adding the following exclusion:\n"
            "\t Coverage will not be provided for the financial consequences that an insured "
            "person may incur if held civilly liable for damage caused by the following "
            "equipment or machinery, or accessories thereof, when mounted on or attached to the specified vehicle:\n"
            " \n"
            "(description of equipment or machinery)\n"
            "For the above exclusion to apply:\n"
            "\t damage must be caused while the equipment or machinery, or accessories thereof, "
            "are at the site of their use; and\n"
            "\t the insured person's civil liability must result from his or her owning the "
            "equipment or machinery, or accessories thereof, or from their use or their operation.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq40_text(self):
        actual = self.fpq1_contract.generate_faq40_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 40\n"
            "Fire deductible\n"
            "(Section B)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement changes Article 7, Section B of the insurance contract as follows: The "
            "deductible for Protection 1, 3 or 4 will apply in the event of a fire.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq13c_text(self):
        actual = self.fpq1_contract.generate_faq13_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 13c\n"
            "Limitation under Protection 3 for vehicle glass\n"
            "(Section B)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement limits coverage under Protection 3, Section B of the insurance contract by excluding"
            "damage caused to the glass of the specified vehicle, except in the case of:\n"
            "\t attempted theft;\n"
            "\t civil commotion;\n"
            "\t earthquakes;\n"
            "\t explosions;\n"
            "\t falling or forced landing of aircraft or parts of aircraft;\n"
            "\t fire;\n"
            "\t hail;\n"
            "\t lightning;\n"
            "\t riot;\n"
            "\t rising water;\n"
            "\t stranding, sinking, burning, derailment or collision of any vehicle or vessel "
            "in or upon which the specified vehicle is being transported;\n"
            "\t theft; and\n"
            "\t windstorms.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq2_text(self):
        actual = self.fpq1_contract.generate_faq2_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 2\n"
            "Vehicles of which named insured is not owner and when driven by named drivers\n"
            "(Section A)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Additional insurance premium payable:\n"
            "\t Amount payable:  \n"
            "\t Due date:  \n"
            "Endorsement description\n"
            "This endorsement extends coverage under Section A of the insurance contract by adding the following "
            "paragraph to Article 2 entitled ''Insured vehicles'':\n"
            "''a vehicle of the   type when driven, at the time of the loss, by one of the "
            "following persons:\n"
            "NAME | AGE | RELATIONSHIP TO NAMED INSURED\n"
            "1. | | \n"
            "2. | | \n"
            "3. | | \n"
            "4. | | \n"
            "For the vehicle to be considered an ''insured vehicle'' under Section A, the following conditions "
            "must be met:\n"
            "1. At the time of the loss, the vehicle is not being driven in connection with a garage business.\n"
            "2. The owner or frequent user of the vehicle is not one of the following persons:\n"
            "\t the named insured or anyone whose domicile is the same as that of the named insured;\n"
            "\t a person mentioned in the table above or anyone whose domicile is the same as that of "
            "such person.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "3. The vehicle is not provided by an employer of:n"
            "\t the named insured or anyone whose domicile is the same as that of the named insured;\n"
            "\t a person mentioned in the table above or anyone whose domicile is the same as that of "
            "such person.\n"
            "4. The vehicle is not appropriated to a use:\n"
            "\t as a taxicab, bus or coach; or\n"
            "\t for commercial delivery.''\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq3_text(self):
        actual = self.fpq1_contract.generate_faq3_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 3\n"
            "''Civil liability'' coverage for vehicle owned by any Canadian government\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Additional insurance premium payable:\n"
            "\t Amount payable:  \n"
            "\t Due date:  \n"
            "Endorsement description\n"
            "This endorsement extends ''civil liability'' coverage under the insurance contract to a vehicle "
            "owned by any Canadian government in the care, custody or control of the insured person. "
            "This endorsement covers the financial consequences that the insured person may suffer if held "
            "civilly liable for:\n"
            "1. Section A:\n"
            "\t damage caused to another person by the vehicle or its equipment or accessories.\n"
            "2. Section B:\n"
            "\t any direct and accidental damage caused to the vehicle or its equipment or accessories; or\n"
            "\t the disappearance of the vehicle or its equipment or accessories.\n"
            "Civil liability may be contractual or extracontractual.\n"
            "Insured person\n"
            "In this ndorsement, ''insured person'' refers to:\n"
            "\t the named insured;\n"
            "\t his or her spouse;\n"
            "\t any person who drives or uses the vehicle.\n"
            "Application\n"
            "This endorsement will not apply if several vehicles owned by any Canadian government are "
            "at any one time in the care of the insured person. It also does not apply if several vehicles "
            "are at any one time in the custody or control of the insured person.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Covered perils, amount of insurance, deductible and insurance premium\n"
            "The perils covered by this endorsement are those for which an amount of insurance, a "
            "deductible or an insurance premium is shown in the table below, or entered specifically for "
            "this endorsement in the ''Declarations'' section of the insurance contract.\n"
            "COVERAGE | PERILS | AMOUNT OF INSURANCE AND DEDUCTIBLE | INSURANCE PREMIUM\n"
            "Section A: Civil liability | Property damage or bodily injury to another person "
            "| Amount of insurance:  $ |  $\n"
            "Section B: Damage to insured vehicles | Protection 1: ''All perils'', Protection 2: Perils "
            "of collision and upset, Protection 3: All perils other than collision or upset, "
            "Protection 4: Specific perils | Deductible per loss: $ $ $ $ | $ $ $ $\n"
            "  |  | Total: | $\n"
            "For Section B, coverage under this endorsement will apply up to a maximum amount "
            "of  $ per loss, plus expenses, costs and interest arising from a lawsuit.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq33_text(self):
        actual = self.fpq1_contract.generate_faq33_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 33\n"
            "Insurance for roadside assistance costs\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Additional insurance premium payable:\n"
            "\t Amount payable:  \n"
            "\t Due date:  \n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement provides that the roadside assistance costs described below and incurred for "
            "the specified vehicle will be reimbursed by the insurer.\n"
            "Roadside assistance costs\n"
            "The costs of the following roadside assistance services will be covered:\n"
            "\t battery boosting;\n"
            "\t door unlocking;\n"
            "\t gas delivery, up to 10 liters;\n"
            "\t towing within a radius of   kilometres (minimum 25 km);\n"
            "\t wheel change.\n"
            "Mechanical repairs and parts or supplies used to repair the specified vehicle are "
            "not covered under this endorsement.\n"
            "Limits of liability\n"
            "\t  $ per event giving rise to roadside assistance charges.\n"
            "\t  $ per policy year.\n"
            "\t   events per policy year.\n"
            "Claim\n"
            "The named insured must justify a claim by submitting to the insurer paid invoices "
            "for the roadside assistance costs.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq32_text(self):
        actual = self.fpq1_contract.generate_faq32_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 32\n"
            "Recreational-purpose vehicles\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N: \n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "Endorsement description\n"
            "This endorsement amends the insurance contract for a recreational-purpose motor vehicle that:\n"
            "\t is specifically designated in Item 3, ''Declarations'' of the insurance contract; or\n"
            "\t is one of the ''insured vehicles'' under the insurance contract.\n"
            "Recreational-purpose motor vehicle\n"
            "''Recreational-purpose motor vehicle'' means, among other things, any motor vehicle, "
            "whether commercially built or otherwise, of a type similar to:\n"
            "\t all-terrain vehicles;\n"
            "\t dune buggies;\n"
            "\t micro-cars;\n"
            "\t minibikes; and\n"
            "\t snowmobiles.\n"
            "Description of amendments\n"
            "1. Section A: Paragraph E, Article 2 entitled ''Insured vehicles'' is replaced with "
            "the following paragraph: ''E. Unless described in the ''Declarations'' section, any "
            "trailer (whether or not the named insured is the owner thereof) used with a "
            "recreational-purpose motor vehicle that is:\n"
            "\t of the same type as that described in the ''Declarations'' section; and\n"
            "\t covered by the insurance contract.\n"
            "2. General conditions: Paragraph (a), Article 7 entitled ''Prohibited use of "
            "insured vehicle'' is replaced with the following paragraph:\n"
            "''(a) When they are not legally authorized to drive;''\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "3. The expressions ''motor vehicle'' and ''motor vehicle used for personal purposes'' are replaced "
            "throughout the insurance contract with the following expression: "
            "''recreational-purpose motor vehicle of the same type as that described in "
            "the ‘Declarations' section.''\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq37a_text(self):
        actual = self.fpq1_contract.generate_faq37ab_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 37 (A-B)\n"
            "Changes to coverage for electronic equipment\n"
            "(Section B)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "Depending on the applicable option, this endorsement changes the coverage under Section B "
            "of the insurance contract for ''electronic equipment'' that is not ''original electronic equipment.''\n"
            "Option A: Limitation of indemnity\n"
            "In the event of a covered loss, the indemnity under Section B will be limited to  $ for "
            "all damaged ''electronic equipment'' that is not ''original electronic equipment.''\n"
            "In addition, the indemnity may not be greater than the ''actual cash value'' of the "
            "damaged ''electronic equipment''.\n"
            "This limitation will apply even when a Q.E.F. No. 43 (A to F) entitled ''Change to "
            "loss payment'' is attached to the insurance contract.\n"
            "Option B: Exclusion from coverage\n"
            "All ''electronic equipment'' that is not ''original electronic equipment'' will be excluded "
            "from coverage under Section B.\n"
            "Definitions\n"
            "1. Electronic equipment\n"
            "The expression ''electronic equipment'' as used in this endorsement means electronic devices:\n"
            "that are installed or meant to be installed permanently in or on the specified vehicle; and\n"
            "that are used for communicating, reproducing or recording sound or images or both "
            "simultaneously, including:\n"
            "\t - compact disc and DVD players;\n"
            "\t - personal navigation devices (GPS);\n"
            "\t - radios, including citizens band, two-way amateur or other radios; and\n"
            "\t - sound systems.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "2. Original electronic equipment\n"
            "The expression ''original electronic equipment'' as used in this endorsement means "
            "the electronic equipment:\n"
            "\t that is installed by the manufacturer or the dealer; and\n"
            "\t that was included in the original purchase price of the specified vehicle.\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq27_text(self):
        actual = self.fpq1_contract.generate_faq27_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 27\n"
            "Civil liability resulting from damage caused to vehicles of which named insured is not owner\n"
            "(including vehicles provided by an employer)\n"
            "(Section A)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Termination date: This endorsement will apply until   at 12:01 A.M. "
            "standard time at the address of the named insured or, if no date is specified, until "
            "the expiry date of the insurance contract.\n"
            "Additional insurance premium payable:\n"
            "\t Amount payable:  \n"
            "\t Due date:  \n"
            "Endorsement description\n"
            "This endorsement extends coverage under Section A of the insurance contract to the financial "
            "consequences that an insured person may incur when civilly liable for:\n"
            "\t damage caused to a vehicle of the  type or its equipment and accessories; and\n"
            "\t disappearance of the vehicle or its equipment and accessories.\n"
            "Civil liability may be contractual or extracontractual.\n"
            "Insured persons\n"
            "In this endorsement, ''insured person'' refers to:\n"
            "\t the named insured;\n"
            "\t his or her spouse;\n"
            "\t any person designated in a Q.E.F. N 2 entitled ''Vehicles of which named insured "
            "is not owner and when driven by named drivers'', attached to the insurance contract;\n"
            "\t the legal representatives and the succession of all the above listed insured persons.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "However, if the named insured is a legal person, partnership or association, "
            "''insured person'' refers to:\n"
            "\t any employee, shareholder, partner or member authorized by the named insured;\n"
            "\t their spouse;\n"
            "\t any person designated in a Q.E.F. N 2, attached to the insurance contract;\n"
            "\t the legal representatives and the succession of all the above listed insured persons.\n"
            "or solely:\n"
            "\t the following persons:  ;\n"
            "\t their spouse;\n"
            "\t any person designated in a Q.E.F. N 2, attached to the insurance contract;\n"
            "\t the legal representatives and the succession of all the above listed insured persons.\n"
            "Application\n"
            "1. The insured person must have the care, custody or control of the vehicle or its "
            "equipment and accessories.\n"
            "2. The insured person or anyone whose domicile is the same as that of the named insured "
            "must not be the owner of the vehicle or its lessee for at least one year or under a contract "
            "of leasing.\n"
            "Covered perils and insurance premium\n"
            "Coverage is provided only for those perils for which a deductible or an insurance "
            "premium is shown in the table below, or entered specifically for this endorsement "
            "in the ''Declarations'' section of the insurance contract:\n"
            "SECTION A: Coverage for civil liability arising from property damage "
            "and bodily injury caused to another person\n"
            " PERILS | DEDUCTIBLE | INSURANCE PREMIUM\n"
            "Protection 1: ''All perils'', Protection 2: Perils of collision and upset, "
            "Protection 3: All perils other than collision or upset, "
            "Protection 4: Specific perils | Deductible per loss:: $ $ $ $ | $ $ $ $ \n"
            "  | Total : |  $"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Clarifications\n"
            "1. Protections 1, 2, 3 and 4 have the same meanings as in Section B of the "
            "insurance contract. The exclusions specified in that section will apply, as the case may be.\n"
            "2. An amount of insurance of  $ will apply per loss, plus expenses, costs and "
            "interest arising from a lawsuit.\n"
            "3. Where applicable, the additional coverage provided under Section A of "
            "the insurance contract may apply.\n"
            "4. The insurer agrees not to exercise any recourse against a person who, with "
            "the insured person's consent, has the care, custody or control of the vehicle or its "
            "equipment and accessories, unless that person:\n"
            "\t was engaged in a garage business at the time of the loss; or\n"
            "\t failed to comply with the insurance contract.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq27a_text(self):
        actual = self.fpq1_contract.generate_faq27a_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 27a\n"
            "Civil liability resulting from damage caused to vehicles of which named insured is not owner\n"
            "(excluding vehicles provided by an employer)\n"
            "(Section A)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Termination date: This endorsement will apply until   at 12:01 A.M. "
            "standard time at the address of the named insured or, if no date is specified, until "
            "the expiry date of the insurance contract.\n"
            "Additional insurance premium payable:\n"
            "\t Amount payable:  \n"
            "\t Due date:  \n"
            "Endorsement description\n"
            "This endorsement extends coverage under Section A of the insurance contract to the financial "
            "consequences that an insured person may incur when civilly liable for:\n"
            "\t damage caused to a vehicle of the  type or its equipment and accessories; and\n"
            "\t disappearance of the vehicle or its equipment and accessories.\n"
            "Civil liability may be contractual or extracontractual.\n"
            "Insured persons\n"
            "In this endorsement, ''insured person'' refers to:\n"
            "\t the named insured;\n"
            "\t his or her spouse;\n"
            "\t any person designated in a Q.E.F. N 2 entitled ''Vehicles of which named insured "
            "is not owner and when driven by named drivers'', attached to the insurance contract;\n"
            "\t the legal representatives and the succession of all the above listed insured persons.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "However, if the named insured is a legal person, partnership or association, "
            "''insured person'' refers to:\n"
            "\t any employee, shareholder, partner or member authorized by the named insured;\n"
            "\t their spouse;\n"
            "\t any person designated in a Q.E.F. N 2, attached to the insurance contract;\n"
            "\t the legal representatives and the succession of all the above listed insured persons.\n"
            "or solely:\n"
            "\t the following persons:  ;\n"
            "\t their spouse;\n"
            "\t any person designated in a Q.E.F. N 2, attached to the insurance contract;\n"
            "\t the legal representatives and the succession of all the above listed insured persons.\n"
            "Application\n"
            "1. The insured person must have the care, custody or control of the vehicle or its "
            "equipment and accessories.\n"
            "2. The insured person or anyone whose domicile is the same as that of the named insured "
            "must not be the owner of the vehicle or its lessee for at least one year or under a contract "
            "of leasing.\n"
            "3. The employer of an insured person or the employer of anyone whose domicile is the same as "
            "that of the named insured must not be the owner of the vehicle or its lessee for at least "
            "one year or under a contract of leasing.\n"
            "Covered perils and insurance premium\n"
            "Coverage is provided only for those perils for which a deductible or an insurance "
            "premium is shown in the table below, or entered specifically for this endorsement "
            "in the ''Declarations'' section of the insurance contract:\n"
            "SECTION A: Coverage for civil liability arising from property damage "
            "and bodily injury caused to another person\n"
            " PERILS | DEDUCTIBLE | INSURANCE PREMIUM\n"
            "Protection 1: ''All perils'', Protection 2: Perils of collision and upset, "
            "Protection 3: All perils other than collision or upset, "
            "Protection 4: Specific perils | Deductible per loss:: $ $ $ $ | $ $ $ $ \n"
            "  | Total : |  $"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Clarifications\n"
            "1. Protections 1, 2, 3 and 4 have the same meanings as in Section B of the "
            "insurance contract. The exclusions specified in that section will apply, as the case may be.\n"
            "2. An amount of insurance of  $ will apply per loss, plus expenses, costs and "
            "interest arising from a lawsuit.\n"
            "3. Where applicable, the additional coverage provided under Section A of "
            "the insurance contract may apply.\n"
            "4. The insurer agrees not to exercise any recourse against a person who, with "
            "the insured person's consent, has the care, custody or control of the vehicle or its "
            "equipment and accessories, unless that person:\n"
            "\t was engaged in a garage business at the time of the loss; or\n"
            "\t failed to comply with the insurance contract.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq28_text(self):
        actual = self.fpq1_contract.generate_faq28_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 28\n"
            "Limitation of coverage for named drivers\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement limits coverage under the insurance contract when the specified vehicle is, "
            "at the time of the loss, being driven or used by:  (named driver)\n"
            "In such instance, coverage will be limited to the following perils, or to those "
            "perils entered specifically for this endorsement in the ''Declarations'' section of the insurance "
            "contract:\n"
            "COVERAGE | PERILS | AMOUNT OF INSURANCE AND DEDUCTIBLE | COVERED/NOT COVERED\n"
            "Section A: Civil liability | Property damage or bodily injury to another person | "
            "Amount of insurance:  $ |  $\n"
            "Section B: Damage to insured vehicles | Protection 1 : ''All perils'', Protection 2 : "
            "Perils of collision and upset, Protection 3: All perils other than collision or upset, "
            "Protection 4: Specific perils | Deductible per loss: $ $ $ $ |      \n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq34_text(self):
        actual = self.fpq1_contract.generate_faq34_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 34\n"
            "Accident benefits insurance\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "TABLE OF CONTENTS\n"
            "APPLICATION 2\n"
            "INSURED PERSONS 2\n"
            "APPLICABLE DIVISION, MAXIMUM AMOUNTS AND INSURANCE PREMIUM 2\n"
            "DESCRIPTION OF DIVISIONS 3\n"
            "EXCLUSIONS 5\n"
            "WHAT TO DO IN THE EVENT OF AN ACCIDENT 6\n"
            "AUTOPSY AND MEDICAL EXAMINATION 6\n"
            "TIME TO PAY BENEFITS 6\n"
            "RIGHTS OF INSURER IN RELATION TO PAYMENT OF BENEFITS OR EXPENSES 7\n"
            "DEFINITIONS 7\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "ENDORSEMENT DESCRIPTION\n"
            "Depending on the applicable division, this endorsement provides for the payment "
            "of benefits when an accident causes bodily injury to an insured person.\n"
            "To determine which division applies, refer to the ''Applicable section, maximum amounts "
            "and insurance premium'' division of this endorsement.\n"
            "APPLICATION\n"
            "1. The motor vehicle must have been the direct cause of bodily injury, independently of "
            "any other cause.\n"
            "2. Benefits are payable per accident and per insured person. If there are several "
            "insured vehicles under the insurance contract, benefits may not be combined\n"
            "3. Only persons who comply with the conditions of the insurance contract and this "
            "endorsement may benefit from the coverage under this endorsement.\n"
            "INSURED PERSONS\n"
            "Under Division 1, ''insured person'' refers to the named insured, his or her spouse and "
            "any dependent children of either.\n"
            "Under Division 2, only the named insured is an ''insured person.''\n"
            "APPLICABLE DIVISION, MAXIMUM AMOUNTS AND INSURANCE PREMIUM\n"
            "Coverage will apply only for the divisions and subdivisions where a maximum amount or an "
            "insurance premium is shown in the table below, or entered specifically for this endorsement "
            "in the ''Declarations'' division of the insurance contract:\n"
            "DIVISION | SUBDIVISION | MAXIMUM | INSURANCE PREMIUM\n"
            "1 | A – Death benefits, B – Dismemberment benefits, C – Reimbursement of medical "
            "expenses | Principal sum $, Principal sum $, Maximum $ |  $,  $,  $"
            "2 Total disability benefits | Maximum  $, per week |  $|\n"
            "  |  | Total:|  $\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "DESCRIPTION OF DIVISIONS\n"
            "Division 1\n"
            "Death and dismemberment benefits and reimbursement of medical expenses\n"
            "Subdivision A - Death benefits\n"
            "When an insured person dies within 12 months after the accident leading to his or her death, "
            "the following benefits will be paid under Subdivision A:\n"
            "\t If the named insured dies: 100% of the principal sum, plus 10% of the principal "
            "sum per dependent child upon the death of the named insured.\n"
            "\t If the spouse of the named insured dies:  % of the principal sum, plus 10% of "
            "the principal sum per dependent child upon the death of the spouse.\n"
            "\t If a dependent child dies:  % of the principal sum.\n"
            "Benefit payments will be made as follows:\n"
            "\t If the insured person dies leaving a spouse, the benefit will be payable to the spouse.\n"
            "\t If the insured person dies without leaving a spouse, the benefit will be payable "
            "to the dependents, in equal shares.\n"
            "\t If the insured person dies without leaving either a spouse or dependents, the benefit "
            "will be payable to the insured person's succession.\n"
            "\t If a dependent child dies, the benefit will be payable to the named insured.\n"
            "If, as a result of the same accident, an insured person should suffer dismemberment and then "
            "die, the benefits that have already been paid under Subdivision B will be deducted from the "
            "benefit payable under Subdivision A.\n"
            "Subdivision B – Dismemberment benefits\n"
            "When an insured person loses his or her sight or a limb within 12 months after "
            "the accident that caused the loss, the following benefits will be paid under Subdivision B:\n"
            "\t Loss of both hands: 100% of the principal sum;\n"
            "\t Loss of both feet: 100% of the principal sum;\n"
            "\t Loss of sight in both eyes: 100% of the principal sum;\n"
            "\t Loss of one hand and one foot: 100% of the principal sum;\n"
            "\t Loss of one hand and sight in one eye: 100% of the principal sum;\n"
            "\t Loss of one foot and sight of one eye: 100% of the principal sum;\n"
            "\t Loss of one arm: 75% of the principal sum;\n"
            "\t Loss of one leg: 75% of the principal sum;\n"
            "\t Loss of one hand: 50% of the principal sum;\n"
            "\t Loss of one foot: 50% of the principal sum;\n"
            "\t Loss of sight in one eye: 50% of the principal sum.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Loss as used with reference to eye means total and irrecoverable loss of sight.\n"
            "Loss as used with reference to a limb means:\n"
            "\t For an arm: complete severance above the elbow.\n"
            "\t For a foot: complete severance through the knee, above the ankle or through the ankle.\n"
            "\t For a hand: complete severance through the elbow, above the wrist or through the wrist.\n"
            "\t For a leg: complete severance above the knee.\n"
            "Benefits provided under this subdivision for the same accident may not exceed 100% of "
            "the principal sum.\n"
            "Subdivision C –- Reimbursement of medical expenses\n"
            "Expenses reasonably incurred for the following services, care or treatments will be "
            "reimbursed under Division C:\n"
            "\t ambulance services;\n"
            "\t dental treatment;\n"
            "\t hospital care;\n"
            "\t medical care;\n"
            "\t professional nursing care;\n"
            "\t surgical treatment.\n"
            "The expenses must have been incurred within two years after the accident that caused them.\n"
            "The total amount of expenses reimbursed for the same accident may not exceed the maximum "
            "for this subsection.\n"
            "Exclusion\n"
            "Subdivision C excludes the portion of medical expenses covered by any other "
            "government or private insurance, unless the other insurance is similar to this coverage.\n"
            "Division 2\n"
            "Total disability benefits\n"
            "Division 2 provides for the payment of an income replacement benefit when the named insured becomes "
            "wholly and continuously disabled as a result of an accident. The income replacement indemnity "
            "will be calculated on a weekly basis and will be payable only in addition to the following amounts:\n"
            "\t amounts payable by the Société de l'assurance automobile du Québec under the Quebec "
            "Automobile Insurance Act; and\n"
            "\t amounts payable under the Act respecting industrial accidents and occupational "
            "disease and the Crime Victims Compensation Act.\n"
            "Conditions\n"
            "1. The named insured must be employed on the date of the accident. The named insured is "
            "deemed to be employed in either of the following situations:\n"
            "\t - he or she was actively engaged in an occupation or employment for wages or profit;\n"
            "\t - he or she was between 21 and 65 years of age and, in the 12 months preceding the accident, "
            "he or she was engaged in an occupation or employment for wages or profit for at least "
            "six months, whether continuously or not.\n"
            "2. The disability must appear within 20 days after the accident that caused it.\n"
            "3. The disability completely prevents the named insured from actively engaging in "
            "his or her occupation or employment."
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Limitations\n"
            "For each accident:\n"
            "The named insured will not be entitled to benefits for the first seven days of disability.\n"
            "Once the seven days have elapsed, the named insured will be entitled to benefits "
            "for a maximum of   weeks.\n"
            "If the disability continues after the maximum number of weeks, benefits will "
            "continue to be payable for a further period of up to   weeks, if:\n"
            "\t continuation of the disability is duly certified; and\n"
            "\t the disability prevents the named insured from engaging in any occupation "
            "or employment for wages or profit on a permanent basis.\n"
            "The named insured may not receive benefits greater than the money value of "
            "any occupation or employment that he engaged in for wages or profit before the accident.\n"
            "If the named insured is covered under several insurance policies, benefits will be calculated as "
            "follows:\n"
            "Money value of all occupations and employment / Total benefits payable for the "
            "disability under all insurance policies X (times) Benefit payable under Division 2 of this endorsement\n"
            "EXCLUSIONS\n"
            "The following exclusions will apply:\n"
            "A. Bodily injury caused directly or indirectly by sickness or disease, unless the "
            "sickness or disease was contracted as a direct result of an accident covered by this endorsement.\n"
            "B. Bodily injury suffered by an insured person who committed or attempted to commit suicide, "
            "whether sane or insane, if this endorsement was not continuously in force for at least two years.\n"
            "C. Whether or not war is declared, bodily injury caused directly or indirectly by:\n"
            "\t bombardment;\n"
            "\t civil war;\n"
            "\t insurrection;\n"
            "\t invasion;\n"
            "\t military power;\n"
            "\t operation of armed forces during hostilities;\n"
            "\t rebellion;\n"
            "\t revolution; and\n"
            "\t usurped power.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "WHAT TO DO IN THE EVENT OF AN ACCIDENT\n"
            "Subdivision A - Death benefits\n"
            "In the event of an accident causing death, a claim must be submitted in writing to the insurer, "
            "accompanied by proof establishing, for example:\n"
            "\t death of the insured person;\n"
            "\t cause of death;\n"
            "\t rights of beneficiaries.\n"
            "Subdivisions B and C, and Division 2 - Dismemberment benefits, reimbursement of medical "
            "expenses and total disability benefits\n"
            "In the event of an accident covered under Subdivision B or C, or Section 2, the insured "
            "person or any other beneficiary must fulfil the obligations outlined below. They may do "
            "so either personally or through an intermediary.\n"
            "Obligations to fulfil:\n"
            "\t Within 30 days of learning of the accident, the person must inform the insurer in writing.\n"
            "\t Within 90 days of learning of the accident, the person must support the claim by providing the "
            "insurer with all the information that the insurer may reasonably expect as to the circumstances "
            "and extent of the accident.\n"
            "\t In the event of failure to satisfy the 30 or 90-day requirement, the person must demonstrate that "
            "he or she was unable to act within those time periods. Benefit payment may be made "
            "nonetheless if the person fulfils his or her obligations within one year after the accident.\n"
            "\t At the insurer's request, the person must provide a medical certificate confirming the following "
            "information:\n"
            "- the cause and nature of the bodily injury for which the claim is being made;\n"
            "- the length of total disability arising from such bodily injury.\n"
            "AUTOPSY AND MEDICAL EXAMINATION\n"
            "Subdivision A - Death benefits\n"
            "If an insured person dies, the insurer may have an autopsy performed, subject to the "
            "requirements set out in the Civil Code of Quebec.\n"
            "Subdivisions B and C, and Division 2 - Dismemberment benefits, reimbursement of medical "
            "expenses and total disability benefits\n"
            "The insurer is entitled to require that the insured person undergo a medical examination within "
            "a reasonable time period, if warranted by the nature of the disability or the loss.\n"
            "The insurer may have the insured person undergo a medical examination as often as may be "
            "reasonably required while the claim is pending.\n"
            "The insured person will be required to submit to such examination.\n"
            "TIME TO PAY BENEFITS\n"
            "Subdivision A - Death benefits\n"
            "The insurer must pay the benefits within 30 days after receipt of the required information and "
            "documents.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Subdivisions B and C - Dismemberment benefits and reimbursement of medical expenses\n"
            "The insurer must pay benefits or reimburse medical expenses within 60 days after receipt of "
            "the required information and documents.\n"
            "Division 2 - Total disability benefits\n"
            "The insurer must pay the initial benefit within 30 days after receipt of the required information "
            "and documents. During the continuation of disability, subsequent payments will be made at 30-day "
            "intervals, subject to submission of the proof set out in the ''What to do in the event of an "
            "accident'' section of this endorsement.\n"
            "RIGHTS OF INSURER IN RELATION TO PAYMENT OF BENEFITS OR EXPENSES\n"
            "The insurer may decide to pay all or part of the benefits or expenses directly to either the "
            "beneficiary or the natural or legal persons providing the medical services, care or treatments. "
            "If any amount remains payable, the total amount of benefits or expenses already paid will then "
            "be deducted from the maximum under the appropriate subsection.\n"
            "Before paying benefits:\n"
            "\t the insurer may require a release from the person to whom it paid a benefit "
            "or reimbursed expenses.\n"
            "\t the insurer may require that it be subrogated to the beneficiary's recourses "
            "against the person responsible for the bodily injury, up to the amount of the benefit it has "
            "paid. This means that the beneficiary's recourses are transferred to the insurer.\n"
            "In addition, the payment of a benefit or the reimbursement of medical expenses will not "
            "constitute an admission of liability as regards the accident. Such payment may therefore not be "
            "set up against the insured person or the insurer in respect of civil liability.\n"
            "DEFINITIONS\n"
            "For the purposes of this endorsement, the following definitions will be in addition to or "
            "will replace the definitions contained in the insurance contract.\n"
            "Bodily injury: Any injury of a physical nature, including death.\n"
            "Dependent child:\n"
            "\t Any child under 18 years of age for whom the named insured or the named "
            "insured's spouse has legal and actual custody;\n"
            "\t Any child 18 years of age or older whose domicile is the same as that of "
            "the named insured and who is entirely dependent on the named insured and/or the named "
            "insured's spouse due to a mental or physical disability.\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Dependents: This expression refers to the following persons:\n"
            "\t any dependent child; and\n"
            "\t the father or mother of the deceased insured person, if the following conditions are met:\n"
            "- the father or mother had the same domicile as the insured person on the date of the accident; and\n"
            "- the father or mother was principally dependent on the insured person for financial support up "
            "to the date of the accident.\n"
            "Named insured:\n"
            "\t The expression ''named insured'' will refer to any person named in Item 1, ''Declarations'' "
            "of the insurance contract;\n"
            "\t If the person named in Item 1 is a legal person, partnership or association, the "
            "expression will refer to each of its employees, shareholders, members or partners who "
            "usually use a described vehicle for which an insurance premium or a maximum amount "
            "is entered specifically for this endorsement (see Item 4, ''Declarations'' of the insurance contract).\n"
            "All other conditions of the insurance contract remain the same.\n"
            f"{new_page}\n"
        )

        self.assertEqual(expected, actual)

    def test_faq34a_text(self):
        actual = self.fpq1_contract.generate_faq34ab_endorsement_text()

        new_page = "<###NEW_PAGE###>"
        expected = (
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Quebec Endorsement Form\n"
            "Q.E.F. N 34 (A-B)\n"
            "Accident benefits insurance\n"
            "(change to amount of insurance or insured persons)\n"
            "The endorsement heading must be entered in the ''Declarations'' section of the insurance contract."
            "Details required for the endorsement may be entered in the ''Declarations'' section or in the endorsement"
            "itself, at the insurer's option.\n"
            "Name of insurer: \n"
            "Named insured: \n"
            "Endorsement to automobile insurance policy N:\n"
            "Effective date: This endorsement will apply from  at 12:01 A.M. "
            "standard time at the address of the named insured.\n"
            "Specified vehicle: This endorsement will apply only to the following described vehicle:\n"
            "(reference number shown in the ''Declarations'' section of the insurance contract)\n"
            "Endorsement description\n"
            "This endorsement changes Q.E.F. N 34 entitled ''Accident benefits'' of the insurance "
            "contract, based on the applicable option.\n"
            "To determine which option applies, see Item 4, ''Declarations'' of the insurance contract.\n"
            "Option 34A – Changes when the named insured is an individual\n"
            "This option provides that, for the persons named in the table below:\n"
            "\t the maximum amounts shown in the table will change those shown in Q.E.F. N "
            "34 by replacing or, where applicable, adding to them;\n"
            "\t coverage will apply only for the divisions and subdivisions where an amount, "
            "an insurance premium or a rebate is shown in the table below, or entered specifically for "
            "this endorsement in the ''Declarations'' section of the insurance contract:\n"
            "MAXIMUM AMOUNTS\n"
            "DIVISION 1 | DIVISION 2\n"
            "Name of insured person | Date of birth | Subdivision A Death benefits (principal sum) | "
            "Subdivision B Dismemberment benefits (principal sum) | "
            "Subdivision C Reimbursement of medical expenses (maximum) | DIVISION 2 Total "
            "disability benefits (maximum, per week) | Insurance premium or rebate\n"
            "1. |  | $ | $ | $ | $ | $\n"
            "2. |  | $ | $ | $ | $ | $\n"
            "3. |  | $ | $ | $ | $ | $\n"
            "4. |  | $ | $ | $ | $ | $\n"
            " |  |  |  |  | Total: |  $\n"
            f"{new_page}\n"
            "ENDORSEMENT(S)\nFORMING A PART OF YOUR AUTOMOBILE INSURANCE POLICY\n"
            "Option 34B – Changes when the named insured is a legal person, partnership or association\n"
            "When the named insured is a legal person, partnership or association, Q.E.F. N 34 will be changed "
            "as follows:\n"
            "\t only the employees, shareholders, members or partners named in the table below will "
            "be considered ''named insureds'';\n"
            "\t coverage will apply only for the divisions and subdivisions where an amount, "
            "an insurance premium or a rebate is shown in the table below, or entered specifically "
            "for this endorsement in the ''Declarations'' section of the insurance contract:\n"
            "MAXIMUM AMOUNTS\n"
            "DIVISION 1 | DIVISION 2\n"
            "Name of insured person | Date of birth | Subdivision A Death benefits (principal sum) | "
            "Subdivision B Dismemberment benefits (principal sum) | "
            "Subdivision C Reimbursement of medical expenses (maximum) | DIVISION 2 Total "
            "disability benefits (maximum, per week) | Insurance premium or rebate\n"
            "1. |  | $ | $ | $ | $ | $\n"
            "2. |  | $ | $ | $ | $ | $\n"
            "3. |  | $ | $ | $ | $ | $\n"
            "4. |  | $ | $ | $ | $ | $\n"
            " |  |  |  |  | Total: |  $\n"
            "All other conditions of the insurance contract remain the same."
        )

        self.assertEqual(expected, actual)
