本文整理汇总了Python中corehq.apps.sms.models.CallLog.by_domain_asc方法的典型用法代码示例。如果您正苦于以下问题:Python CallLog.by_domain_asc方法的具体用法?Python CallLog.by_domain_asc怎么用?Python CallLog.by_domain_asc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.apps.sms.models.CallLog
的用法示例。
在下文中一共展示了CallLog.by_domain_asc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_log_call
# 需要导入模块: from corehq.apps.sms.models import CallLog [as 别名]
# 或者: from corehq.apps.sms.models.CallLog import by_domain_asc [as 别名]
def test_log_call(self):
if self.__class__ == LogCallTestCase:
# The test runner picks up this base class too, but we only
# want to run the test on subclasses.
return
self.assertEqual(CallLog.count_by_domain(self.domain), 0)
response = self.simulate_inbound_call(self.phone_number)
self.check_response(response)
self.assertEqual(CallLog.count_by_domain(self.domain), 1)
call = CallLog.by_domain_asc(self.domain).all()[0]
self.assertEqual(call.couch_recipient_doc_type, 'CommCareCase')
self.assertEqual(call.couch_recipient, self.case.get_id)
self.assertEqual(call.direction, INCOMING)
示例2: delete_call_logs
# 需要导入模块: from corehq.apps.sms.models import CallLog [as 别名]
# 或者: from corehq.apps.sms.models.CallLog import by_domain_asc [as 别名]
def delete_call_logs(self, domain):
calls = CallLog.by_domain_asc(domain).all()
if calls:
CallLog.get_db().bulk_delete([
call.to_json() for call in calls
])