From 2d7370a525622ee02345b65f15a312555d2fe0ab Mon Sep 17 00:00:00 2001 From: Pranav Nachanekar Date: Tue, 10 Sep 2019 16:46:17 +0530 Subject: [PATCH] Moved delete_appointment --- erpnext/crm/doctype/appointment/test_appointment.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/crm/doctype/appointment/test_appointment.py b/erpnext/crm/doctype/appointment/test_appointment.py index 96c4e4fc05..8487b258f2 100644 --- a/erpnext/crm/doctype/appointment/test_appointment.py +++ b/erpnext/crm/doctype/appointment/test_appointment.py @@ -18,6 +18,11 @@ def create_appointments(number): 'customer_skype': 'test'+str(i), }) +def delete_appointments(): + doc_list = frappe.get_list('Appointment',filters={'scheduled_time':datetime.datetime.min,'customer_phone_number':'8088'}) + for doc in doc_list: + doc.delete() + class TestAppointment(unittest.TestCase): def setUp(self): @@ -34,14 +39,9 @@ class TestAppointment(unittest.TestCase): def tearDown(self): delete_appointments() - def delete_appointments(self): - doc_list = frappe.get_list('Appointment',filters={'scheduled_time':datetime.datetime.min,'customer_phone_number':'8088'}) - for doc in doc_list: - doc.delete() - def test_number_of_appointments(self): settings = frappe.get_doc('Appointment Booking Settings') self.assertFalse(frappe.db.exists('Apoointment', - filters={'scheduled_time': datetime.datetime.min, 'customer_name':'Extra Customer'}), + filters={'scheduled_time': datetime.datetime.min, 'customer_name':'Extra Cu'}), settings.number_of_agents, "Number of appointments exceed number of agents")