From f9dec5201fe9fe789dd26ca91498f2b92414967c Mon Sep 17 00:00:00 2001 From: 0Pranav Date: Mon, 25 Nov 2019 16:42:07 +0530 Subject: [PATCH] fix:tests --- erpnext/crm/doctype/appointment/appointment.py | 2 +- erpnext/crm/doctype/appointment/test_appointment.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/crm/doctype/appointment/appointment.py b/erpnext/crm/doctype/appointment/appointment.py index 91d1c03f7d..b6962d923a 100644 --- a/erpnext/crm/doctype/appointment/appointment.py +++ b/erpnext/crm/doctype/appointment/appointment.py @@ -28,7 +28,7 @@ class Appointment(Document): number_of_appointments_in_same_slot = frappe.db.count( 'Appointment', filters={'scheduled_time': self.scheduled_time}) number_of_agents = frappe.db.get_single_value('Appointment Booking Settings', 'number_of_agents') - if(number_of_appointments_in_same_slot >= number_of_agents): + if (number_of_appointments_in_same_slot >= number_of_agents): frappe.throw('Time slot is not available') # Link lead if not self.lead: diff --git a/erpnext/crm/doctype/appointment/test_appointment.py b/erpnext/crm/doctype/appointment/test_appointment.py index 50c98c59de..0dac2bb9ae 100644 --- a/erpnext/crm/doctype/appointment/test_appointment.py +++ b/erpnext/crm/doctype/appointment/test_appointment.py @@ -24,7 +24,7 @@ def create_test_lead(): def create_test_appointments(): test_appointment = frappe.db.exists( {'doctype': 'Appointment', 'scheduled_time':datetime.datetime.now(),'email':'test@example.com'}) - if test_appointment: + if test_appointment[0][0]: return frappe.get_doc('Appointment', test_appointment[0][0]) test_appointment = frappe.get_doc({ 'doctype': 'Appointment',