diff --git a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py index 8aaf36192b7..dc7d1d21595 100644 --- a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py @@ -643,6 +643,7 @@ class TestPaymentEntry(ERPNextTestSuite): def test_payment_entry_retrieves_last_exchange_rate(self): from erpnext.setup.doctype.currency_exchange.test_currency_exchange import save_new_records + self.load_test_records("Currency Exchange") save_new_records(self.globalTestRecords["Currency Exchange"]) pe = frappe.new_doc("Payment Entry") @@ -980,6 +981,7 @@ class TestPaymentEntry(ERPNextTestSuite): def test_gl_of_multi_currency_payment_transaction(self): from erpnext.setup.doctype.currency_exchange.test_currency_exchange import save_new_records + self.load_test_records("Currency Exchange") save_new_records(self.globalTestRecords["Currency Exchange"]) paid_from = create_account( parent_account="Current Liabilities - _TC", diff --git a/erpnext/setup/doctype/currency_exchange/test_records.json b/erpnext/setup/doctype/currency_exchange/test_records.json new file mode 100644 index 00000000000..152060edfc4 --- /dev/null +++ b/erpnext/setup/doctype/currency_exchange/test_records.json @@ -0,0 +1,56 @@ +[ + { + "doctype": "Currency Exchange", + "date": "2016-01-01", + "exchange_rate": 60.0, + "from_currency": "USD", + "to_currency": "INR", + "for_buying": 1, + "for_selling": 0 + }, + { + "doctype": "Currency Exchange", + "date": "2016-01-01", + "exchange_rate": 0.773, + "from_currency": "USD", + "to_currency": "EUR", + "for_buying": 0, + "for_selling": 1 + }, + { + "doctype": "Currency Exchange", + "date": "2016-01-01", + "exchange_rate": 0.0167, + "from_currency": "INR", + "to_currency": "USD", + "for_buying": 1, + "for_selling": 0 + }, + { + "doctype": "Currency Exchange", + "date": "2016-01-10", + "exchange_rate": 65.1, + "from_currency": "USD", + "to_currency": "INR", + "for_buying": 1, + "for_selling": 0 + }, + { + "doctype": "Currency Exchange", + "date": "2016-01-30", + "exchange_rate": 62.9, + "from_currency": "USD", + "to_currency": "INR", + "for_buying": 1, + "for_selling": 1 + }, + { + "doctype": "Currency Exchange", + "date": "2016-01-10", + "exchange_rate": 65.1, + "from_currency": "INR", + "to_currency": "NGN", + "for_buying": 1, + "for_selling": 1 + } +]