diff --git a/ihatemoney/tests/tests.py b/ihatemoney/tests/tests.py index 48ae95c0..6e03e674 100644 --- a/ihatemoney/tests/tests.py +++ b/ihatemoney/tests/tests.py @@ -1146,6 +1146,7 @@ class BudgetTestCase(IhatemoneyTestCase): "payed_for": [1, 2, 3, 4], "amount": "10.0", "original_currency": "USD", + "original_amount": "10.0", }, ) @@ -1158,6 +1159,7 @@ class BudgetTestCase(IhatemoneyTestCase): "payed_for": [1, 3], "amount": "200", "original_currency": "USD", + "original_amount": "200", }, ) @@ -1170,6 +1172,7 @@ class BudgetTestCase(IhatemoneyTestCase): "payed_for": [2], "amount": "13.33", "original_currency": "USD", + "original_amount": "13.33", }, ) diff --git a/ihatemoney/utils.py b/ihatemoney/utils.py index 5c911eb7..696db6bf 100644 --- a/ihatemoney/utils.py +++ b/ihatemoney/utils.py @@ -29,6 +29,9 @@ class CurrencyConverter(object): return currencies def exchange_currency(self, amount, currency1, currency2): + if currency1 == currency2: + return amount + base = self.response["base"] conversion_rate1 = self.response["rates"][currency1] conversion_rate2 = self.response["rates"][currency2]