01.04.26
This commit is contained in:
@@ -71,6 +71,27 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
strategy.get_mtm(line, Decimal('10')),
|
||||
Decimal('250.00'))
|
||||
|
||||
def test_get_strategy_mtm_price_returns_unit_price(self):
|
||||
'strategy mtm price exposes the unit valuation price'
|
||||
strategy = Mock(
|
||||
scenario=Mock(
|
||||
valuation_date='2026-03-29',
|
||||
use_last_price=True,
|
||||
),
|
||||
currency=Mock(),
|
||||
)
|
||||
strategy.components = [Mock(
|
||||
price_source_type='curve',
|
||||
price_index=Mock(get_price=Mock(return_value=Decimal('100'))),
|
||||
price_matrix=None,
|
||||
ratio=Decimal('25'),
|
||||
)]
|
||||
line = Mock(unit=Mock())
|
||||
|
||||
self.assertEqual(
|
||||
valuation_module.Valuation._get_strategy_mtm_price(strategy, line),
|
||||
Decimal('25.0000'))
|
||||
|
||||
def test_parse_numbers_supports_inline_and_legacy_separators(self):
|
||||
'parse_numbers keeps supporting inline entry and legacy separators'
|
||||
self.assertEqual(
|
||||
|
||||
Reference in New Issue
Block a user