mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 05:09:11 +00:00
fix failing tests
This commit is contained in:
@@ -11,7 +11,9 @@ from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings
|
||||
from frappe.utils.nestedset import get_root_of
|
||||
from erpnext.accounts.utils import get_account_name
|
||||
|
||||
class WebsitePriceListMissingError(frappe.ValidationError): pass
|
||||
|
||||
class WebsitePriceListMissingError(frappe.ValidationError):
|
||||
pass
|
||||
|
||||
def set_cart_count(quotation=None):
|
||||
if cint(frappe.db.get_singles_value("Shopping Cart Settings", "enabled")):
|
||||
@@ -98,6 +100,7 @@ def update_cart(item_code, qty, with_items=False):
|
||||
apply_cart_settings(quotation=quotation)
|
||||
|
||||
quotation.flags.ignore_permissions = True
|
||||
quotation.payment_schedule = []
|
||||
if not empty_card:
|
||||
quotation.save()
|
||||
else:
|
||||
@@ -173,6 +176,7 @@ def decorate_quotation_doc(doc):
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def _get_cart_quotation(party=None):
|
||||
'''Return the open Quotation of type "Shopping Cart" or make a new one'''
|
||||
if not party:
|
||||
@@ -194,7 +198,7 @@ def _get_cart_quotation(party=None):
|
||||
"status": "Draft",
|
||||
"docstatus": 0,
|
||||
"__islocal": 1,
|
||||
"payment_terms_template": "_Test Payment Terms Template",
|
||||
"payment_terms_template": "_Test Payment Term Template",
|
||||
(party.doctype.lower()): party.name
|
||||
})
|
||||
|
||||
|
||||
@@ -8,6 +8,9 @@ from frappe.utils import nowdate, add_months
|
||||
from erpnext.shopping_cart.cart import _get_cart_quotation, update_cart, get_party
|
||||
from erpnext.tests.utils import create_test_contact_and_address
|
||||
|
||||
|
||||
test_dependencies = ['Payment Terms Template']
|
||||
|
||||
class TestShoppingCart(unittest.TestCase):
|
||||
"""
|
||||
Note:
|
||||
@@ -62,7 +65,6 @@ class TestShoppingCart(unittest.TestCase):
|
||||
self.assertEquals(quotation.get("items")[0].qty, 1)
|
||||
self.assertEquals(quotation.get("items")[0].amount, 10)
|
||||
|
||||
|
||||
# add second item
|
||||
update_cart("_Test Item 2", 1)
|
||||
quotation = self.test_get_cart_customer()
|
||||
|
||||
Reference in New Issue
Block a user