@@ -68,7 +68,17 @@ def test_keeps_safe_haven_when_cash_projection_exceeds_small_account_limit(self)
6868 self .assertEqual (result .targets ["BOXX" ], 5000.0 )
6969 self .assertEqual (result .whole_share_substituted_symbols , ("SOXX" ,))
7070 self .assertEqual (result .safe_haven_cash_substituted_symbols , ())
71- self .assertEqual (result .cash_substitution_notes , ())
71+ self .assertEqual (
72+ result .cash_substitution_notes ,
73+ (
74+ {
75+ "symbol" : "SOXX" ,
76+ "target_value" : 163.14 ,
77+ "price" : 504.60 ,
78+ "cash_symbols" : (),
79+ },
80+ ),
81+ )
7282
7383 def test_formats_cash_substitution_notes_through_i18n (self ):
7484 messages = format_small_account_cash_substitution_notes (
@@ -85,7 +95,7 @@ def test_formats_cash_substitution_notes_through_i18n(self):
8595 "buy_deferred" : "ℹ️ [买入说明] {detail}" ,
8696 "buy_deferred_small_account_cash_substitution" : (
8797 "{symbol} 目标金额 ${diff} 低于 1 股价格 ${price};"
88- "为避免超过目标仓位,小账户本轮保留现金,不回补 {cash_symbols}"
98+ "为避免超过目标仓位,本轮保留现金(现金替代: {cash_symbols}) "
8999 ),
90100 }.get (key , key ).format (** kwargs ),
91101 )
@@ -94,7 +104,7 @@ def test_formats_cash_substitution_notes_through_i18n(self):
94104 messages ,
95105 (
96106 "ℹ️ [买入说明] SOXX.US 目标金额 $163.14 低于 1 股价格 $504.60;"
97- "为避免超过目标仓位,小账户本轮保留现金,不回补 BOXX.US" ,
107+ "为避免超过目标仓位,本轮保留现金(现金替代: BOXX.US) " ,
98108 ),
99109 )
100110
0 commit comments