test: assert error if quotation contains non website item

This commit is contained in:
Devin Slauenwhite 2021-12-30 12:38:18 -05:00 committed by marination
parent 678a1179d4
commit 86832fb7fe

View File

@ -129,7 +129,20 @@ class TestQuotation(FrappeTestCase):
quotation.insert()
quotation.submit()
self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name)
def test_shopping_cart_without_website_item(self):
from erpnext.selling.doctype.quotation.quotation import make_sales_order
if frappe.db.exists('Website Item', {'item_code': '_Test Item Home Desktop 100'}):
frappe.get_last_doc('Website Item', {'item_code': '_Test Item Home Desktop 100'}).delete()
quotation = frappe.copy_doc(test_records[0])
quotation.order_type = 'Shopping Cart'
quotation.valid_till = getdate()
quotation.insert()
quotation.submit()
self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name)
def test_create_quotation_with_margin(self):
from erpnext.selling.doctype.quotation.quotation import make_sales_order
from erpnext.selling.doctype.sales_order.sales_order import (