From 37581eafb18f0d6fd0444c351d04f91425d9863d Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Tue, 19 Jan 2016 07:14:00 +0100
Subject: [PATCH] Fix tests relative referentials

---
 .../tests/unit/core/money/test_relative.py    | 20 +++++++++----------
 .../unit/core/money/test_relative_to_past.py  | 16 +++++++--------
 .../unit/core/money/test_relative_zsum.py     |  8 ++++----
 3 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/sakia/tests/unit/core/money/test_relative.py b/src/sakia/tests/unit/core/money/test_relative.py
index 1791fb3e..ae542b05 100644
--- a/src/sakia/tests/unit/core/money/test_relative.py
+++ b/src/sakia/tests/unit/core/money/test_relative.py
@@ -64,7 +64,7 @@ class TestRelative(unittest.TestCase, QuamashTest):
     @patch('sakia.core.Community')
     @patch('sakia.core.Application')
     def test_localized_with_si(self, app, community):
-        community.dividend = CoroutineMock(return_value=10000)
+        community.dividend = CoroutineMock(return_value=1000000)
         type(community).short_currency = PropertyMock(return_value="TC")
         app.preferences = {
             'digits_after_comma': 6
@@ -72,7 +72,7 @@ class TestRelative(unittest.TestCase, QuamashTest):
         referential = Relative(1011, community, app, None)
         async def exec_test():
             value = await referential.localized(units=True, international_system=True)
-            self.assertEqual(value, "1.011000 dUD TC")
+            self.assertEqual(value, "1.011000 mUD TC")
         self.lp.run_until_complete(exec_test())
 
     @patch('sakia.core.Community')
@@ -92,7 +92,7 @@ class TestRelative(unittest.TestCase, QuamashTest):
     @patch('sakia.core.Community')
     @patch('sakia.core.Application')
     def test_localized_no_units_with_si(self, app, community):
-        community.dividend = CoroutineMock(return_value=10000)
+        community.dividend = CoroutineMock(return_value=1000000)
         type(community).short_currency = PropertyMock(return_value="TC")
         app.preferences = {
             'digits_after_comma': 6
@@ -100,7 +100,7 @@ class TestRelative(unittest.TestCase, QuamashTest):
         referential = Relative(1011, community, app, None)
         async def exec_test():
             value = await referential.localized(units=False, international_system=True)
-            self.assertEqual(value, "1.011000 dUD ")
+            self.assertEqual(value, "1.011000 mUD ")
         self.lp.run_until_complete(exec_test())
 
     @patch('sakia.core.Community')
@@ -120,7 +120,7 @@ class TestRelative(unittest.TestCase, QuamashTest):
     @patch('sakia.core.Community')
     @patch('sakia.core.Application')
     def test_diff_localized_with_si(self, app, community):
-        community.dividend = CoroutineMock(return_value=10000)
+        community.dividend = CoroutineMock(return_value=1000000)
         type(community).short_currency = PropertyMock(return_value="TC")
         app.preferences = {
             'digits_after_comma': 6
@@ -128,13 +128,13 @@ class TestRelative(unittest.TestCase, QuamashTest):
         referential = Relative(1011, community, app, None)
         async def exec_test():
             value = await referential.diff_localized(units=True, international_system=True)
-            self.assertEqual(value, "1.011000 dUD TC")
+            self.assertEqual(value, "1.011000 mUD TC")
         self.lp.run_until_complete(exec_test())
 
     @patch('sakia.core.Community')
     @patch('sakia.core.Application')
     def test_diff_localized_no_units_no_si(self, app, community):
-        community.dividend = CoroutineMock(return_value=10000)
+        community.dividend = CoroutineMock(return_value=1000000)
         type(community).short_currency = PropertyMock(return_value="TC")
         app.preferences = {
             'digits_after_comma': 6
@@ -142,13 +142,13 @@ class TestRelative(unittest.TestCase, QuamashTest):
         referential = Relative(1011, community, app, None)
         async def exec_test():
             value = await referential.diff_localized(units=False, international_system=False)
-            self.assertEqual(value, "0.101100")
+            self.assertEqual(value, "0.001011")
         self.lp.run_until_complete(exec_test())
 
     @patch('sakia.core.Community')
     @patch('sakia.core.Application')
     def test_diff_localized_no_units_with_si(self, app, community):
-        community.dividend = CoroutineMock(return_value=10000)
+        community.dividend = CoroutineMock(return_value=1000000)
         type(community).short_currency = PropertyMock(return_value="TC")
         app.preferences = {
             'digits_after_comma': 6
@@ -156,5 +156,5 @@ class TestRelative(unittest.TestCase, QuamashTest):
         referential = Relative(1011, community, app, None)
         async def exec_test():
             value = await referential.diff_localized(units=False, international_system=True)
-            self.assertEqual(value, "1.011000 dUD ")
+            self.assertEqual(value, "1.011000 mUD ")
         self.lp.run_until_complete(exec_test())
\ No newline at end of file
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 1ad2cb74..0a0f5e2d 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
@@ -69,7 +69,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest):
     @patch('sakia.core.Community')
     @patch('sakia.core.Application')
     def test_localized_with_si(self, app, community):
-        community.dividend = CoroutineMock(return_value=10000)
+        community.dividend = CoroutineMock(return_value=1000000)
         community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792})
         type(community).short_currency = PropertyMock(return_value="TC")
         app.preferences = {
@@ -78,7 +78,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest):
         referential = RelativeToPast(1011, community, app, 100)
         async def exec_test():
             value = await referential.localized(units=True, international_system=True)
-            self.assertEqual(value, "1.011000 dUD({0}) TC".format(QLocale.toString(
+            self.assertEqual(value, "1.011000 mUD({0}) TC".format(QLocale.toString(
                             QLocale(),
                             QDateTime.fromTime_t(1452663088792).date(),
                             QLocale.dateFormat(QLocale(), QLocale.ShortFormat)
@@ -103,7 +103,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest):
     @patch('sakia.core.Community')
     @patch('sakia.core.Application')
     def test_localized_no_units_with_si(self, app, community):
-        community.dividend = CoroutineMock(return_value=10000)
+        community.dividend = CoroutineMock(return_value=1000000)
         community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792})
         type(community).short_currency = PropertyMock(return_value="TC")
         app.preferences = {
@@ -112,7 +112,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest):
         referential = RelativeToPast(1011, community, app, 100)
         async def exec_test():
             value = await referential.localized(units=False, international_system=True)
-            self.assertEqual(value, "1.011000 dUD({0}) ".format(QLocale.toString(
+            self.assertEqual(value, "1.011000 mUD({0}) ".format(QLocale.toString(
                             QLocale(),
                             QDateTime.fromTime_t(1452663088792).date(),
                             QLocale.dateFormat(QLocale(), QLocale.ShortFormat)
@@ -141,7 +141,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest):
     @patch('sakia.core.Community')
     @patch('sakia.core.Application')
     def test_diff_localized_with_si(self, app, community):
-        community.dividend = CoroutineMock(return_value=10000)
+        community.dividend = CoroutineMock(return_value=1000000)
         community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792})
         type(community).short_currency = PropertyMock(return_value="TC")
         app.preferences = {
@@ -150,7 +150,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest):
         referential = RelativeToPast(1011, community, app, 100)
         async def exec_test():
             value = await referential.diff_localized(units=True, international_system=True)
-            self.assertEqual(value, "1.011000 dUD({0}) TC".format(QLocale.toString(
+            self.assertEqual(value, "1.011000 mUD({0}) TC".format(QLocale.toString(
                             QLocale(),
                             QDateTime.fromTime_t(1452663088792).date(),
                             QLocale.dateFormat(QLocale(), QLocale.ShortFormat)
@@ -175,7 +175,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest):
     @patch('sakia.core.Community')
     @patch('sakia.core.Application')
     def test_diff_localized_no_units_with_si(self, app, community):
-        community.dividend = CoroutineMock(return_value=10000)
+        community.dividend = CoroutineMock(return_value=1000000)
         community.get_block = CoroutineMock(return_value={'medianTime': 1452663088792})
         type(community).short_currency = PropertyMock(return_value="TC")
         app.preferences = {
@@ -184,7 +184,7 @@ class TestRelativeToPast(unittest.TestCase, QuamashTest):
         referential = RelativeToPast(1011, community, app, 100)
         async def exec_test():
             value = await referential.diff_localized(units=False, international_system=True)
-            self.assertEqual(value, "1.011000 dUD({0}) ".format(QLocale.toString(
+            self.assertEqual(value, "1.011000 mUD({0}) ".format(QLocale.toString(
                             QLocale(),
                             QDateTime.fromTime_t(1452663088792).date(),
                             QLocale.dateFormat(QLocale(), QLocale.ShortFormat)
diff --git a/src/sakia/tests/unit/core/money/test_relative_zsum.py b/src/sakia/tests/unit/core/money/test_relative_zsum.py
index e6430c3b..2a820899 100644
--- a/src/sakia/tests/unit/core/money/test_relative_zsum.py
+++ b/src/sakia/tests/unit/core/money/test_relative_zsum.py
@@ -81,7 +81,7 @@ class TestRelativeZSum(unittest.TestCase, QuamashTest):
         referential = RelativeZSum(110, community, app, None)
         async def exec_test():
             value = await referential.localized(units=True, international_system=True)
-            self.assertEqual(value, "1.000000 dR0 TC")
+            self.assertEqual(value, "100.000000 mR0 TC")
         self.lp.run_until_complete(exec_test())
 
     @patch('sakia.core.Community')
@@ -115,7 +115,7 @@ class TestRelativeZSum(unittest.TestCase, QuamashTest):
         referential = RelativeZSum(110, community, app, None)
         async def exec_test():
             value = await referential.localized(units=False, international_system=True)
-            self.assertEqual(value, "1.000000 dR0 ")
+            self.assertEqual(value, "100.000000 mR0 ")
         self.lp.run_until_complete(exec_test())
 
     @patch('sakia.core.Community')
@@ -146,7 +146,7 @@ class TestRelativeZSum(unittest.TestCase, QuamashTest):
         referential = RelativeZSum(90, community, app, None)
         async def exec_test():
             value = await referential.diff_localized(units=True, international_system=True)
-            self.assertEqual(value, "9.000000 dR0 TC")
+            self.assertEqual(value, "900.000000 mR0 TC")
         self.lp.run_until_complete(exec_test())
 
     @patch('sakia.core.Community')
@@ -180,5 +180,5 @@ class TestRelativeZSum(unittest.TestCase, QuamashTest):
         referential = RelativeZSum(90, community, app, None)
         async def exec_test():
             value = await referential.diff_localized(units=False, international_system=True)
-            self.assertEqual(value, "9.000000 dR0 ")
+            self.assertEqual(value, "900.000000 mR0 ")
         self.lp.run_until_complete(exec_test())
-- 
GitLab