Skip to content

Test helpers

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

CALocalAccountFinancialInstrumentFactory

Bases: AlanBaseFactory

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)),
    )
)

legal_entity class-attribute instance-attribute

legal_entity = SubFactory(LegalEntityFactory)

IBANAccountFinancialInstrumentFactory

Bases: AlanBaseFactory

Meta

model class-attribute instance-attribute
model = IBANAccountFinancialInstrument

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

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())