def generate_future(asset_manager_id=None, asset_id=None):
    props = generate_common(asset_manager_id=asset_manager_id,
                            asset_id=asset_id)
    asset = Future(settlement_type=random.choice(['Cash', 'Physical']),
                   contract_size=10000,
                   point_value=Decimal('50'),
                   tick_size=Decimal('0.01'),
                   expiry_date=random_date(start_year=date.today().year + 1),
                   **props)
    return asset
Exemplo n.º 2
0
def generate_wine(asset_manager_id=None, asset_id=None):
    props = generate_common(asset_manager_id=asset_manager_id, asset_id=asset_id)
    wine = Wine(year=random_date(start_year=1950, end_year=2016),
                producer=random_string(5),
                region=random.choice(['Bordeaux', 'Burgundy', 'Tuscany', 'Napa Valley']),
                appellation=random.choice([None]*3 + ['Côtes du Rhône', 'Graves', 'Saint-Émilion']),
                classification=random.choice(list(WINE_CLASSIFICATIONS)),
                color=random.choice(['Red', 'White']),
                bottle_size=random.choice(['0.75L']*3 + ['1.5L']),
                bottle_in_cellar=random.choice([True]*3 + [False]),
                bottle_location=random_string(20),
                storage_cost=None,
                rating_type='Parker',
                rating_value=random.randint(93, 100),
                packing_type=random.choice(list(WINE_PACKING_TYPE)),
                to_drink_start=random_date(start_year=2000),
                to_drink_end=random_date(end_year=2050),
                comments = {'DrinkingNotes': Comment(comment_value=random_string(100))},
                **props)
    return wine
def generate_fx_forward(asset_manager_id=None,
                        asset_id=None,
                        settlement_date=None):
    props = generate_common(asset_manager_id=asset_manager_id,
                            asset_id=asset_id,
                            display_name=asset_id)
    asset = ForeignExchangeForward(forward_rate=random_decimal(),
                                   settlement_date=settlement_date
                                   or random_date(start_year=2017),
                                   **props)
    return asset
def generate_private_investment(asset_manager_id=None,
                                asset_id=None,
                                client_id=None):
    attributes = generate_common(asset_manager_id=None, asset_id=None)
    """currency, display_name"""
    private_investment = PrivateInvestment(
        client_id=client_id or random_string(5),
        asset_issuer_id=random_string(8),
        category='Private Equity',
        sub_category='Leverage Buyout Funds',
        num_shares=1000,
        price_share=1000,
        share_type='Ordinary Shares',
        maturity_date=random_date(),
        lock_up_period=52,
        investment_term=52,
        **attributes)
    return private_investment
Exemplo n.º 5
0
def generate_sukuk(asset_manager_id=None, asset_id=None):
    props = generate_common(asset_manager_id=asset_manager_id,
                            asset_id=asset_id)
    sukuk = Sukuk(maturity_date=random_date(end_year=2050), **props)
    return sukuk
Exemplo n.º 6
0
 def test_RandomDate(self):
     test_date = random_date(start_year=2005, end_year=2005)
     self.assertEqual(type(test_date), date)
     self.assertEqual(test_date.year, 2005)