[enhancement] Merge Comment and Feed into Communication 💥

Depends on frappe/frappe#1532
This commit is contained in:
Anand Doshi
2016-01-19 18:38:08 +05:30
parent 467f5c7a75
commit 17d4fc4fa7
33 changed files with 3037 additions and 2942 deletions

View File

@@ -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"]