mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
refactor(test): flaky PE test; load currency exchange record
This commit is contained in:
@@ -643,6 +643,7 @@ class TestPaymentEntry(ERPNextTestSuite):
|
|||||||
def test_payment_entry_retrieves_last_exchange_rate(self):
|
def test_payment_entry_retrieves_last_exchange_rate(self):
|
||||||
from erpnext.setup.doctype.currency_exchange.test_currency_exchange import save_new_records
|
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"])
|
save_new_records(self.globalTestRecords["Currency Exchange"])
|
||||||
|
|
||||||
pe = frappe.new_doc("Payment Entry")
|
pe = frappe.new_doc("Payment Entry")
|
||||||
@@ -980,6 +981,7 @@ class TestPaymentEntry(ERPNextTestSuite):
|
|||||||
def test_gl_of_multi_currency_payment_transaction(self):
|
def test_gl_of_multi_currency_payment_transaction(self):
|
||||||
from erpnext.setup.doctype.currency_exchange.test_currency_exchange import save_new_records
|
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"])
|
save_new_records(self.globalTestRecords["Currency Exchange"])
|
||||||
paid_from = create_account(
|
paid_from = create_account(
|
||||||
parent_account="Current Liabilities - _TC",
|
parent_account="Current Liabilities - _TC",
|
||||||
|
|||||||
56
erpnext/setup/doctype/currency_exchange/test_records.json
Normal file
56
erpnext/setup/doctype/currency_exchange/test_records.json
Normal 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
|
||||||
|
}
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user