aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--portfolio.py2
-rw-r--r--tests/test_portfolio.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/portfolio.py b/portfolio.py
index 94472a3..1d29106 100644
--- a/portfolio.py
+++ b/portfolio.py
@@ -52,7 +52,7 @@ class Amount:
52 ticker=asset_ticker, 52 ticker=asset_ticker,
53 rate=rate) 53 rate=rate)
54 else: 54 else:
55 raise Exception("This asset is not available in the chosen market") 55 return Amount(other_currency, 0, linked_to=self, ticker=None, rate=0)
56 56
57 def as_json(self): 57 def as_json(self):
58 return { 58 return {
diff --git a/tests/test_portfolio.py b/tests/test_portfolio.py
index d4e5ab9..cad3095 100644
--- a/tests/test_portfolio.py
+++ b/tests/test_portfolio.py
@@ -1856,7 +1856,7 @@ class AmountTest(WebMockTestCase):
1856 with self.subTest(desc="no ticker for currency"): 1856 with self.subTest(desc="no ticker for currency"):
1857 self.m.get_ticker.return_value = None 1857 self.m.get_ticker.return_value = None
1858 1858
1859 self.assertRaises(Exception, amount.in_currency, "ETH", self.m) 1859 self.assertEqual(portfolio.Amount("ETH", 0), amount.in_currency("ETH", self.m))
1860 1860
1861 with self.subTest(desc="nominal case"): 1861 with self.subTest(desc="nominal case"):
1862 self.m.get_ticker.return_value = { 1862 self.m.get_ticker.return_value = {