def METHOD_NAME(self):
    """Test initializer, type, attachment, de/serialization."""
    for proof_req in INDY_PROOF_REQ:
        pres_proposal = V20PresProposal(
            comment="Hello World",
            formats=[
                V20PresFormat(
                    attach_id="indy",
                    format_=ATTACHMENT_FORMAT[PRES_20_PROPOSAL][
                        V20PresFormat.Format.INDY.api
                    ],
                )
            ],
            proposals_attach=[AttachDecorator.data_base64(proof_req, ident="indy")],
        )
        assert pres_proposal._type == DIDCommPrefix.qualify_current(
            PRES_20_PROPOSAL
        )
        assert pres_proposal.attachment(V20PresFormat.Format.INDY) == proof_req
        pres_proposal_ser = pres_proposal.serialize()
        pres_proposal_deser = V20PresProposal.deserialize(pres_proposal_ser)
        assert type(pres_proposal_deser) == V20PresProposal
        pres_proposal_dict = pres_proposal_deser.serialize()
        assert pres_proposal_dict == pres_proposal_ser
        pres_proposal_dict["formats"][0]["attach_id"] = "xxx"
        with pytest.raises(BaseModelError):
            V20PresProposal.deserialize(pres_proposal_dict)  # id mismatch
        pres_proposal_dict["formats"] = []
        with pytest.raises(BaseModelError):
            V20PresProposal.deserialize(pres_proposal_dict)  # length mismatch
        pres_proposal.formats.append(  # unknown format: no validation
            V20PresFormat(
                attach_id="not_indy",
                format_="not_indy",
            )
        )
        obj = pres_proposal.serialize()
        obj["proposals~attach"].append(
            {
                "@id": "not_indy",
                "mime-type": "application/json",
                "data": {"base64": "eyJub3QiOiAiaW5keSJ9"},
            }
        )
        V20PresProposal.deserialize(obj)