fix:tests
This commit is contained in:
parent
3ec5eabaf6
commit
f9dec5201f
@ -28,7 +28,7 @@ class Appointment(Document):
|
|||||||
number_of_appointments_in_same_slot = frappe.db.count(
|
number_of_appointments_in_same_slot = frappe.db.count(
|
||||||
'Appointment', filters={'scheduled_time': self.scheduled_time})
|
'Appointment', filters={'scheduled_time': self.scheduled_time})
|
||||||
number_of_agents = frappe.db.get_single_value('Appointment Booking Settings', 'number_of_agents')
|
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')
|
frappe.throw('Time slot is not available')
|
||||||
# Link lead
|
# Link lead
|
||||||
if not self.lead:
|
if not self.lead:
|
||||||
|
@ -24,7 +24,7 @@ def create_test_lead():
|
|||||||
def create_test_appointments():
|
def create_test_appointments():
|
||||||
test_appointment = frappe.db.exists(
|
test_appointment = frappe.db.exists(
|
||||||
{'doctype': 'Appointment', 'scheduled_time':datetime.datetime.now(),'email':'test@example.com'})
|
{'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])
|
return frappe.get_doc('Appointment', test_appointment[0][0])
|
||||||
test_appointment = frappe.get_doc({
|
test_appointment = frappe.get_doc({
|
||||||
'doctype': 'Appointment',
|
'doctype': 'Appointment',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user