mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
test: validation on mixed condition with recursion
This commit is contained in:
@@ -129,6 +129,25 @@ class TestPromotionalScheme(unittest.TestCase):
|
|||||||
[pr.min_qty, pr.free_item, pr.free_qty, pr.recurse_for], [12, "_Test Item 2", 1, 12]
|
[pr.min_qty, pr.free_item, pr.free_qty, pr.recurse_for], [12, "_Test Item 2", 1, 12]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_validation_on_recurse_with_mixed_condition(self):
|
||||||
|
ps = make_promotional_scheme()
|
||||||
|
ps.set("price_discount_slabs", [])
|
||||||
|
ps.set(
|
||||||
|
"product_discount_slabs",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"rule_description": "12+1",
|
||||||
|
"min_qty": 12,
|
||||||
|
"free_item": "_Test Item 2",
|
||||||
|
"free_qty": 1,
|
||||||
|
"is_recursive": 1,
|
||||||
|
"recurse_for": 12,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
)
|
||||||
|
ps.mixed_conditions = True
|
||||||
|
self.assertRaises(frappe.ValidationError, ps.save)
|
||||||
|
|
||||||
|
|
||||||
def make_promotional_scheme(**args):
|
def make_promotional_scheme(**args):
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
|
|||||||
Reference in New Issue
Block a user