mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
[enhancement] Merge Comment and Feed into Communication 💥
Depends on frappe/frappe#1532
This commit is contained in:
@@ -187,9 +187,11 @@ class TestShoppingCart(unittest.TestCase):
|
||||
frappe.local.shopping_cart_settings = None
|
||||
|
||||
def login_as_new_user(self):
|
||||
self.create_user_if_not_exists("test_cart_user@example.com")
|
||||
frappe.set_user("test_cart_user@example.com")
|
||||
|
||||
def login_as_customer(self):
|
||||
self.create_user_if_not_exists("test_contact_customer@example.com")
|
||||
frappe.set_user("test_contact_customer@example.com")
|
||||
|
||||
def remove_all_items_from_cart(self):
|
||||
@@ -197,5 +199,17 @@ class TestShoppingCart(unittest.TestCase):
|
||||
quotation.set("items", [])
|
||||
quotation.save(ignore_permissions=True)
|
||||
|
||||
def create_user_if_not_exists(self, email):
|
||||
if frappe.db.exists("User", email):
|
||||
return
|
||||
|
||||
frappe.get_doc({
|
||||
"doctype": "User",
|
||||
"user_type": "Website User",
|
||||
"email": email,
|
||||
"send_welcome_email": 0,
|
||||
"first_name": email.split("@")[0]
|
||||
}).insert(ignore_permissions=True)
|
||||
|
||||
test_dependencies = ["Sales Taxes and Charges Template", "Price List", "Item Price", "Shipping Rule", "Currency Exchange",
|
||||
"Customer Group", "Lead", "Customer", "Contact", "Address", "Item", "Tax Rule"]
|
||||
|
||||
Reference in New Issue
Block a user