def METHOD_NAME(self):
    # Set a qty = 2 in one line of a contract
    self.contract3.contract_line_ids.filtered(
        lambda line: line.name == "Line"
    ).quantity = 2
    wizard = (
        self.env["split.contract"]
        .with_context(active_id=self.contract3.id)
        .create({})
    )
    wizard.partner_id = self.partner_2.id
    wizard.split_line_ids.quantity_to_split = 0
    initial_contracts_length = self.env["contract.contract"].search_count([])
    # set quantity to split in the wizard
    wizard.split_line_ids.filtered(lambda l: l.name == "Line").quantity_to_split = 1
    # confirm wizard with setting to_split quantities
    new_contract = wizard.action_split_contract()
    # A new contract must have been created.
    self.assertEqual(
        initial_contracts_length + 1, self.env["contract.contract"].search_count([])
    )
    # new contract has partner_2 as partner_id
    self.assertEqual(self.partner_2.id, new_contract.partner_id.id)
    # new contract has now the splitted line with a qty of one
    self.assertEqual(1, len(new_contract.contract_line_ids.ids))
    self.assertEqual(1, new_contract.contract_line_ids.quantity)
    self.assertEqual(
        self.contract3,
        new_contract.contract_line_ids.mapped("splitted_from_contract_id"),
    )
    # Original contract still has 3 lines but with a qty=1 in the last line named "Line"
    self.assertEqual(3, len(self.contract3.contract_line_ids.ids))
    self.assertEqual(
        1,
        self.contract3.contract_line_ids.filtered(
            lambda l: l.name == "Line"
        ).quantity,
    )