fixed Test Cases
This commit is contained in:
parent
6cce304b27
commit
68f66a7e8b
@ -106,4 +106,11 @@ class TestItem(unittest.TestCase):
|
||||
variant.item_name = "_Test Variant Item-S"
|
||||
variant.save()
|
||||
|
||||
def make_item_variant():
|
||||
if not frappe.db.exists("Item", "_Test Variant Item-S"):
|
||||
variant = create_variant("_Test Variant Item", """{"Test Size": "Small"}""")
|
||||
variant.item_code = "_Test Variant Item-S"
|
||||
variant.item_name = "_Test Variant Item-S"
|
||||
variant.save()
|
||||
|
||||
test_records = frappe.get_test_records('Item')
|
||||
|
@ -42,6 +42,6 @@ class ItemAttribute(Document):
|
||||
variant_attributes = frappe.db.sql("select DISTINCT attribute_value from `tabVariant Attribute` where attribute=%s", self.name)
|
||||
if variant_attributes:
|
||||
for d in variant_attributes:
|
||||
if d[0] not in attribute_values:
|
||||
if d[0] and d[0] not in attribute_values:
|
||||
frappe.throw(_("Attribute Value {0} cannot be removed from {1} as Item Variants \
|
||||
exist with this Attribute.").format(d[0], self.name))
|
||||
|
@ -66,6 +66,8 @@ class TestStockEntry(unittest.TestCase):
|
||||
frappe.db.set_default("allow_negative_stock", 0)
|
||||
|
||||
def test_auto_material_request(self):
|
||||
from erpnext.stock.doctype.item.test_item import make_item_variant
|
||||
make_item_variant()
|
||||
self._test_auto_material_request("_Test Item")
|
||||
|
||||
def test_auto_material_request_for_variant(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user