Skip to content

Test helpers

components.payment_gateway.subcomponents.parties.models.tests.factories

CALocalAccountFinancialInstrumentFactory

Bases: AlanBaseFactory['CALocalAccountFinancialInstrument']

Meta

model class-attribute instance-attribute
model = CALocalAccountFinancialInstrument

ca_local_account_data class-attribute instance-attribute

ca_local_account_data = LazyFunction(
    lambda: CALocalAccountData(
        institution_number=numerify(text="###"),
        transit_number=numerify(text="#####"),
        account_number=numerify(text="#" * randint(7, 12)),
    )
)

display_value class-attribute instance-attribute

display_value = Faker(
    "numerify", text="###-#####-******###"
)

legal_entity class-attribute instance-attribute

legal_entity = SubFactory(LegalEntityFactory)

FinancialInstrumentProviderMappingFactory

Bases: AlanBaseFactory['FinancialInstrumentProviderMapping']

Meta

model class-attribute instance-attribute
model = FinancialInstrumentProviderMapping

external_id class-attribute instance-attribute

external_id = LazyFunction(lambda: uuid4())

financial_instrument class-attribute instance-attribute

financial_instrument = SubFactory(
    IBANAccountFinancialInstrumentFactory
)

mapping_metadata class-attribute instance-attribute

mapping_metadata = LazyFunction(
    lambda: {
        "account_id": uuid4(),
        "counterparty_id": uuid4(),
    }
)

workspace_key class-attribute instance-attribute

workspace_key = Faker('random_string', length=16)

IBANAccountFinancialInstrumentFactory

Bases: AlanBaseFactory['IBANAccountFinancialInstrument']

Meta

model class-attribute instance-attribute
model = IBANAccountFinancialInstrument

display_value class-attribute instance-attribute

display_value = Faker(
    "numerify", text="FR76 #### **** **** **** **** ###"
)

iban_account_data class-attribute instance-attribute

iban_account_data = LazyFunction(
    lambda: IBANAccountData(
        iban=iban(),
        bank_country_code=country_code(
            representation="alpha-2"
        ),
        bic=swift(),
    )
)

legal_entity class-attribute instance-attribute

legal_entity = SubFactory(LegalEntityFactory)

LegalEntityFactory

Bases: AlanBaseFactory['LegalEntity']

Meta

model class-attribute instance-attribute
model = LegalEntity

address_city class-attribute instance-attribute

address_city = Faker('city')

address_country_code class-attribute instance-attribute

address_country_code = Faker(
    "country_code", representation="alpha-2"
)

address_postal_code class-attribute instance-attribute

address_postal_code = Faker('postcode')

address_street class-attribute instance-attribute

address_street = Faker('street_address')

entity_type class-attribute instance-attribute

entity_type = ORGANIZATION

legal_country_code class-attribute instance-attribute

legal_country_code = Faker(
    "country_code", representation="alpha-2"
)

legal_name class-attribute instance-attribute

legal_name = Faker('company')

unique_key class-attribute instance-attribute

unique_key = LazyFunction(lambda: uuid4())