def factory_entity_service(business_identifier='CP1234567',
                           business_number='791861073BC0001',
                           name='Foobar, Inc.'):
    """Produce a templated entity model."""
    entity = EntityModel.create_from_dict({
        'business_identifier': business_identifier,
        'business_number': business_number,
        'name': name
    })
    entity.save()
    entity_service = EntityService(entity)
    return entity_service
Beispiel #2
0
def factory_entity_service(entity_info: dict = TestEntityInfo.entity1):
    """Produce a templated entity service."""
    entity_model = factory_entity_model(entity_info)
    entity_service = EntityService(entity_model)
    return entity_service