From da8adea0a9b206931cac6a7a96eb89534eb7517d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 30 Jun 2014 17:28:52 +0530 Subject: [PATCH] Fixed customer test --- erpnext/selling/doctype/customer/test_customer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index a1db1cea41..50ec56515c 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -41,6 +41,10 @@ class TestCustomer(unittest.TestCase): self.assertEquals(value, details.get(key)) def test_rename(self): + for name in ("_Test Customer 1", "_Test Customer 1 Renamed"): + frappe.db.sql("""delete from `tabComment` where comment_doctype=%s and comment_docname=%s""", + ("Customer", name)) + comment = frappe.new_doc("Comment") comment.update({ "comment": "Test Comment for Rename", @@ -56,7 +60,7 @@ class TestCustomer(unittest.TestCase): # test that comment gets renamed self.assertEquals(frappe.db.get_value("Comment", - {"comment_doctype": "Customer", "comment_docname": "Test Customer 1 Renamed"}), comment.name) + {"comment_doctype": "Customer", "comment_docname": "_Test Customer 1 Renamed"}), comment.name) frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1")