test: test case to validate free item is ignored when qty is zero

(cherry picked from commit a2b41a0c16)
This commit is contained in:
Ninad1306
2024-10-11 14:02:50 +05:30
committed by Mergify
parent ae47fb9617
commit 3b1f0c191e

View File

@@ -981,6 +981,12 @@ class TestPricingRule(FrappeTestCase):
self.assertEqual(so.items[1].item_code, "_Test Item")
self.assertEqual(so.items[1].qty, 3)
so = make_sales_order(item_code="_Test Item", qty=5, do_not_submit=1)
so.items[0].qty = 1
del so.items[-1]
so.save()
self.assertEqual(len(so.items), 1)
def test_apply_multiple_pricing_rules_for_discount_percentage_and_amount(self):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 1")
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 2")