test: Fix erroneous code
diff --git a/erpnext/tests/test_exotel.py b/erpnext/tests/test_exotel.py
index d2e317a..a5dc7dd 100644
--- a/erpnext/tests/test_exotel.py
+++ b/erpnext/tests/test_exotel.py
@@ -16,15 +16,14 @@
create_contact("Test Contact", "Mr", phones=phones)
def test_for_successful_call(self):
- from .exotel_test_data import call_initiation_data, call_end_data
+ from .exotel_test_data import call_end_data, call_initiation_data
+
api_method = "handle_incoming_call"
end_call_api_method = "handle_end_call"
-
emulate_api_call(call_initiation_data, api_method)
emulate_api_call(call_end_data, end_call_api_method)
- self.assertEqual(call_log.get("from"), "09999999991")
- self.assertEqual(call_log.get("to"), "09999999999")
+
call_log = frappe.get_doc("Call Log", call_initiation_data.CallSid)
self.assertEqual(call_log.get("from"), call_initiation_data.CallFrom)
@@ -34,6 +33,7 @@
def test_for_disconnected_call(self):
from .exotel_test_data import call_disconnected_data
+
api_method = "handle_missed_call"
emulate_api_call(call_disconnected_data, api_method)
call_log = frappe.get_doc("Call Log", call_disconnected_data.CallSid)
@@ -45,6 +45,7 @@
def test_for_call_not_answered(self):
from .exotel_test_data import call_not_answered_data
+
api_method = "handle_missed_call"
emulate_api_call(call_not_answered_data, api_method)
@@ -66,7 +67,8 @@
res.raise_for_status()
time.sleep(1)
+
def get_exotel_handler_endpoint(method):
site = "localhost" if os.environ.get("CI") else frappe.local.site
port = frappe.get_site_config().webserver_port or "8000"
- return f"http://{site}:{port}/api/method/erpnext.erpnext_integrations.exotel_integration.{method}"
\ No newline at end of file
+ return f"http://{site}:{port}/api/method/erpnext.erpnext_integrations.exotel_integration.{method}"