From fb6d410e60f64bf806394082b86a6c5bcd6575f2 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Wed, 11 Sep 2013 16:18:10 +0530 Subject: [PATCH] [fix] test cases fix for price list --- buying/doctype/supplier/supplier.py | 6 ------ selling/doctype/customer/customer.py | 6 ------ selling/doctype/customer/test_customer.py | 2 ++ setup/doctype/customer_group/test_customer_group.py | 3 +++ setup/doctype/price_list/test_price_list.py | 2 ++ setup/doctype/setup_control/setup_control.py | 5 ++++- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/buying/doctype/supplier/supplier.py b/buying/doctype/supplier/supplier.py index 75b2e03762..1fd2d0cba4 100644 --- a/buying/doctype/supplier/supplier.py +++ b/buying/doctype/supplier/supplier.py @@ -135,11 +135,6 @@ class DocType(TransactionBase): for rec in sql("select * from `tabContact` where supplier=%s", (self.doc.name,), as_dict=1): sql("delete from `tabContact` where name=%s",(rec['name'])) - def delete_supplier_communication(self): - webnotes.conn.sql("""\ - delete from `tabCommunication` - where supplier = %s and customer is null""", self.doc.name) - def delete_supplier_account(self): """delete supplier's ledger if exist and check balance before deletion""" acc = sql("select name from `tabAccount` where master_type = 'Supplier' \ @@ -151,7 +146,6 @@ class DocType(TransactionBase): def on_trash(self): self.delete_supplier_address() self.delete_supplier_contact() - self.delete_supplier_communication() self.delete_supplier_account() def on_rename(self, new, old, merge=False): diff --git a/selling/doctype/customer/customer.py b/selling/doctype/customer/customer.py index fb3c0062a7..8c42a71eb8 100644 --- a/selling/doctype/customer/customer.py +++ b/selling/doctype/customer/customer.py @@ -128,11 +128,6 @@ class DocType(TransactionBase): def delete_customer_contact(self): for rec in sql("select * from `tabContact` where customer=%s", (self.doc.name,), as_dict=1): sql("delete from `tabContact` where name=%s",(rec['name'])) - - def delete_customer_communication(self): - webnotes.conn.sql("""\ - delete from `tabCommunication` - where customer = %s and supplier is null""", self.doc.name) def delete_customer_account(self): """delete customer's ledger if exist and check balance before deletion""" @@ -145,7 +140,6 @@ class DocType(TransactionBase): def on_trash(self): self.delete_customer_address() self.delete_customer_contact() - self.delete_customer_communication() self.delete_customer_account() if self.doc.lead_name: sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name) diff --git a/selling/doctype/customer/test_customer.py b/selling/doctype/customer/test_customer.py index 9ed821ab74..7c90f6a1a8 100644 --- a/selling/doctype/customer/test_customer.py +++ b/selling/doctype/customer/test_customer.py @@ -57,6 +57,8 @@ class TestCustomer(unittest.TestCase): # check that old name doesn't exist self.assertEqual(webnotes.conn.exists("Customer", "_Test Customer"), ()) self.assertEqual(webnotes.conn.exists("Account", "_Test Customer - _TC"), ()) + +test_ignore = ["Price List"] test_records = [ [{ diff --git a/setup/doctype/customer_group/test_customer_group.py b/setup/doctype/customer_group/test_customer_group.py index 14233af82e..11140d6965 100644 --- a/setup/doctype/customer_group/test_customer_group.py +++ b/setup/doctype/customer_group/test_customer_group.py @@ -1,6 +1,9 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt +test_ignore = ["Price List"] + + test_records = [ [{ "doctype": "Customer Group", diff --git a/setup/doctype/price_list/test_price_list.py b/setup/doctype/price_list/test_price_list.py index 2310f51478..b1174d364b 100644 --- a/setup/doctype/price_list/test_price_list.py +++ b/setup/doctype/price_list/test_price_list.py @@ -13,6 +13,8 @@ class TestItem(unittest.TestCase): price_list.doclist.append(webnotes.doc(item_price.fields.copy())) self.assertRaises(PriceListDuplicateItem, price_list.insert) +# test_ignore = ["Item"] + test_records = [ [ { diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py index 54c0e28e40..0bc2f24ca7 100644 --- a/setup/doctype/setup_control/setup_control.py +++ b/setup/doctype/setup_control/setup_control.py @@ -101,7 +101,6 @@ class DocType: 'default_currency': args.get('currency'), 'default_company':args.get('company_name'), 'date_format': webnotes.conn.get_value("Country", args.get("country"), "date_format"), - 'emp_created_by':'Naming Series', "float_precision": 4 }) global_defaults.save() @@ -135,6 +134,10 @@ class DocType: notification_control.doc.purchase_order = 1 notification_control.save() + hr_settings = webnotes.bean("HR Settings") + hr_settings.doc.emp_created_by = "Naming Series" + hr_settings.save() + # control panel cp = webnotes.doc("Control Panel", "Control Panel") for k in ['country', 'timezone', 'company_name']: