refactor(test): flaky PE test; load currency exchange record

This commit is contained in:
ruthra kumar
2025-06-21 07:43:04 +05:30
parent 56542c805a
commit a5a6a3bc9c
2 changed files with 58 additions and 0 deletions

View File

@@ -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",

View File

@@ -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
}
]