test: also accept a mid-range rounding loss allowance

This commit is contained in:
Nabin Hait
2026-07-03 17:07:31 +05:30
parent 65500d5102
commit ed77392741

View File

@@ -321,8 +321,9 @@ class TestExchangeRateRevaluationValidation(ERPNextTestSuite):
for bad in (-0.1, 1, 1.5):
doc = self._revaluation_with_rows([], rounding_loss_allowance=bad)
self.assertRaises(frappe.ValidationError, doc.validate)
# a value inside [0, 1) is accepted
self._revaluation_with_rows([], rounding_loss_allowance=0.0).validate()
# values inside [0, 1) are accepted, at the lower bound and mid-range
for good in (0.0, 0.5):
self._revaluation_with_rows([], rounding_loss_allowance=good).validate()
def test_gain_loss_computed_and_split_by_zero_balance(self):
doc = self._revaluation_with_rows(