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

This commit is contained in:
Ninad1306
2024-10-11 14:02:50 +05:30
parent 7ae98f77ee
commit a2b41a0c16

View File

@@ -1140,6 +1140,12 @@ class TestPricingRule(IntegrationTestCase):
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")