fix shipping rule test cases (copy name with copy_doc)
diff --git a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py
index c53689e..d14bcd7 100644
--- a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py
+++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py
@@ -10,11 +10,13 @@
class TestShippingRule(unittest.TestCase):
def test_from_greater_than_to(self):
shipping_rule = frappe.copy_doc(test_records[0])
+ shipping_rule.name = test_records[0].get('name')
shipping_rule.get("shipping_rule_conditions")[0].from_value = 101
self.assertRaises(FromGreaterThanToError, shipping_rule.insert)
def test_many_zero_to_values(self):
shipping_rule = frappe.copy_doc(test_records[0])
+ shipping_rule.name = test_records[0].get('name')
shipping_rule.get("shipping_rule_conditions")[0].to_value = 0
self.assertRaises(ManyBlankToValuesError, shipping_rule.insert)
@@ -27,8 +29,9 @@
((50, 150), (50, 150)),
]:
shipping_rule = frappe.copy_doc(test_records[0])
+ shipping_rule.name = test_records[0].get('name')
shipping_rule.get("shipping_rule_conditions")[0].from_value = range_a[0]
shipping_rule.get("shipping_rule_conditions")[0].to_value = range_a[1]
shipping_rule.get("shipping_rule_conditions")[1].from_value = range_b[0]
shipping_rule.get("shipping_rule_conditions")[1].to_value = range_b[1]
- self.assertRaises(OverlappingConditionError, shipping_rule.insert)
\ No newline at end of file
+ self.assertRaises(OverlappingConditionError, shipping_rule.insert)