mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 21:59:13 +00:00
@@ -6,6 +6,7 @@ from frappe.tests import IntegrationTestCase, change_settings
|
||||
from frappe.utils import add_days, add_months, flt, getdate, nowdate
|
||||
|
||||
from erpnext.controllers.accounts_controller import InvalidQtyError
|
||||
from erpnext.setup.utils import get_exchange_rate
|
||||
|
||||
EXTRA_TEST_RECORD_DEPENDENCIES = ["Product Bundle"]
|
||||
|
||||
@@ -863,6 +864,24 @@ class TestQuotation(IntegrationTestCase):
|
||||
quotation.reload()
|
||||
self.assertEqual(quotation.status, "Ordered")
|
||||
|
||||
@change_settings("Accounts Settings", {"allow_pegged_currencies_exchange_rates": True})
|
||||
def test_make_quotation_qar_to_inr(self):
|
||||
quotation = make_quotation(
|
||||
currency="QAR",
|
||||
transaction_date="2026-06-04",
|
||||
)
|
||||
|
||||
cache = frappe.cache()
|
||||
key = "currency_exchange_rate_{}:{}:{}".format("2026-06-04", "QAR", "INR")
|
||||
value = cache.get(key)
|
||||
expected_rate = flt(value) / 3.64
|
||||
|
||||
self.assertEqual(
|
||||
quotation.conversion_rate,
|
||||
expected_rate,
|
||||
f"Expected conversion rate {expected_rate}, got {quotation.conversion_rate}",
|
||||
)
|
||||
|
||||
|
||||
def enable_calculate_bundle_price(enable=1):
|
||||
selling_settings = frappe.get_doc("Selling Settings")
|
||||
|
||||
Reference in New Issue
Block a user