def test_get_cart_lead(self):
		self.login_as_lead()

		# test if quotation with lead is fetched
		quotation = get_quotation()
		self.assertEquals(quotation.quotation_to, "Lead")
		self.assertEquals(quotation.lead, frappe.db.get_value("Lead", {"email_id": "*****@*****.**"}))
		self.assertEquals(quotation.customer, None)
		self.assertEquals(quotation.contact_email, frappe.session.user)

		return quotation
	def test_get_cart_customer(self):
		self.login_as_customer()

		# test if quotation with customer is fetched
		quotation = get_quotation()
		self.assertEquals(quotation.quotation_to, "Customer")
		self.assertEquals(quotation.customer, "_Test Customer")
		self.assertEquals(quotation.lead, None)
		self.assertEquals(quotation.contact_email, frappe.session.user)

		return quotation
Example #3
0
    def test_get_cart_customer(self):
        self.login_as_customer()

        # test if quotation with customer is fetched
        quotation = get_quotation()
        self.assertEquals(quotation.quotation_to, "Customer")
        self.assertEquals(quotation.customer, "_Test Customer")
        self.assertEquals(quotation.lead, None)
        self.assertEquals(quotation.contact_email, frappe.session.user)

        return quotation
Example #4
0
	def test_get_cart_lead(self):
		self.login_as_lead()

		# test if quotation with lead is fetched
		quotation = get_quotation()
		self.assertEquals(quotation.quotation_to, "Lead")
		self.assertEquals(quotation.lead, frappe.db.get_value("Lead", {"email_id": "*****@*****.**"}))
		self.assertEquals(quotation.customer, None)
		self.assertEquals(quotation.contact_email, frappe.session.user)

		return quotation
Example #5
0
	def test_get_cart_new_user(self):
		self.login_as_new_user()

		# test if lead is created and quotation with new lead is fetched
		quotation = get_quotation()
		self.assertEquals(quotation.quotation_to, "Lead")
		self.assertEquals(frappe.db.get_value("Lead", quotation.lead, "email_id"), "*****@*****.**")
		self.assertEquals(quotation.customer, None)
		self.assertEquals(quotation.contact_email, frappe.session.user)

		return quotation
	def remove_all_items_from_cart(self):
		quotation = get_quotation()
		quotation.set("items", [])
		quotation.save(ignore_permissions=True)
Example #7
0
 def remove_all_items_from_cart(self):
     quotation = get_quotation()
     quotation.set("items", [])
     quotation.save(ignore_permissions=True)