diff --git a/src/sakia/core/money/relative_to_past.py b/src/sakia/core/money/relative_to_past.py index 315ee105db899083a3d94e3c51013fdcaafd20cc..b92e5dc10a398f586827a8cec8007c1ad2da050c 100644 --- a/src/sakia/core/money/relative_to_past.py +++ b/src/sakia/core/money/relative_to_past.py @@ -72,7 +72,7 @@ class RelativeToPast(BaseReferential): async def localized(self, units=False, international_system=False): from . import Relative value = await self.value() - block = await self.community.get_block() + block = await self.community.get_ud_block() prefix = "" if international_system: localized_value, prefix = Relative.to_si(value, self.app.preferences['digits_after_comma']) @@ -95,7 +95,7 @@ class RelativeToPast(BaseReferential): async def diff_localized(self, units=False, international_system=False): from . import Relative value = await self.differential() - block = await self.community.get_block(self._block_number) + block = await self.community.get_ud_block(0, self._block_number) prefix = "" if international_system and value != 0: localized_value, prefix = Relative.to_si(value, self.app.preferences['digits_after_comma']) diff --git a/src/sakia/tests/unit/core/money/test_relative_to_past.py b/src/sakia/tests/unit/core/money/test_relative_to_past.py index c65c13780feab149eee91276a757d431739f596b..61d6b05518e040ed298fff6796e4a1fd4e7e26b1 100644 --- a/src/sakia/tests/unit/core/money/test_relative_to_past.py +++ b/src/sakia/tests/unit/core/money/test_relative_to_past.py @@ -51,7 +51,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest): @patch('sakia.core.Application') def test_localized_no_si(self, app, community): community.dividend = CoroutineMock(return_value=1000) - community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792}) + community.get_ud_block = CoroutineMock(return_value={'medianTime': 1452663088792}) type(community).short_currency = PropertyMock(return_value="TC") app.preferences = { 'digits_after_comma': 6 @@ -70,7 +70,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest): @patch('sakia.core.Application') def test_localized_with_si(self, app, community): community.dividend = CoroutineMock(return_value=1000000) - community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792}) + community.get_ud_block = CoroutineMock(return_value={'medianTime': 1452663088792}) type(community).short_currency = PropertyMock(return_value="TC") app.preferences = { 'digits_after_comma': 6 @@ -89,7 +89,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest): @patch('sakia.core.Application') def test_localized_no_units_no_si(self, app, community): community.dividend = CoroutineMock(return_value=10000) - community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792}) + community.get_ud_block = CoroutineMock(return_value={'medianTime': 1452663088792}) type(community).short_currency = PropertyMock(return_value="TC") app.preferences = { 'digits_after_comma': 6 @@ -104,7 +104,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest): @patch('sakia.core.Application') def test_localized_no_units_with_si(self, app, community): community.dividend = CoroutineMock(return_value=1000000) - community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792}) + community.get_ud_block = CoroutineMock(return_value={'medianTime': 1452663088792}) type(community).short_currency = PropertyMock(return_value="TC") app.preferences = { 'digits_after_comma': 6 @@ -123,7 +123,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest): @patch('sakia.core.Application') def test_diff_localized_no_si(self, app, community): community.dividend = CoroutineMock(return_value=10000) - community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792}) + community.get_ud_block = CoroutineMock(return_value={'medianTime': 1452663088792}) type(community).short_currency = PropertyMock(return_value="TC") app.preferences = { 'digits_after_comma': 6 @@ -142,7 +142,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest): @patch('sakia.core.Application') def test_diff_localized_with_si(self, app, community): community.dividend = CoroutineMock(return_value=1000000) - community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792}) + community.get_ud_block = CoroutineMock(return_value={'medianTime': 1452663088792}) type(community).short_currency = PropertyMock(return_value="TC") app.preferences = { 'digits_after_comma': 6 @@ -161,7 +161,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest): @patch('sakia.core.Application') def test_diff_localized_no_units_no_si(self, app, community): community.dividend = CoroutineMock(return_value=10000) - community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792}) + community.get_ud_block = CoroutineMock(return_value={'medianTime': 1452663088792}) type(community).short_currency = PropertyMock(return_value="TC") app.preferences = { 'digits_after_comma': 6 @@ -176,7 +176,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest): @patch('sakia.core.Application') def test_diff_localized_no_units_with_si(self, app, community): community.dividend = CoroutineMock(return_value=1000000) - community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792}) + community.get_ud_block = CoroutineMock(return_value={'medianTime': 1452663088792}) type(community).short_currency = PropertyMock(return_value="TC") app.preferences = { 'digits_after_comma': 6