当前位置: 首页>>代码示例>>Python>>正文


Python CallLog.count_by_domain方法代码示例

本文整理汇总了Python中corehq.apps.sms.models.CallLog.count_by_domain方法的典型用法代码示例。如果您正苦于以下问题:Python CallLog.count_by_domain方法的具体用法?Python CallLog.count_by_domain怎么用?Python CallLog.count_by_domain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在corehq.apps.sms.models.CallLog的用法示例。


在下文中一共展示了CallLog.count_by_domain方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_401_response

# 需要导入模块: from corehq.apps.sms.models import CallLog [as 别名]
# 或者: from corehq.apps.sms.models.CallLog import count_by_domain [as 别名]
    def test_401_response(self):
        start_count = CallLog.count_by_domain(self.domain)

        response = Client().post('/twilio/ivr/xxxxx', {
            'From': self.phone_number,
            'CallSid': 'xyz',
        })
        self.assertEqual(response.status_code, 401)

        end_count = CallLog.count_by_domain(self.domain)
        self.assertEqual(start_count, end_count)
开发者ID:philipkaare,项目名称:commcare-hq,代码行数:13,代码来源:test_log_call.py

示例2: test_log_call

# 需要导入模块: from corehq.apps.sms.models import CallLog [as 别名]
# 或者: from corehq.apps.sms.models.CallLog import count_by_domain [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)
开发者ID:philipkaare,项目名称:commcare-hq,代码行数:17,代码来源:util.py

示例3: handle

# 需要导入模块: from corehq.apps.sms.models import CallLog [as 别名]
# 或者: from corehq.apps.sms.models.CallLog import count_by_domain [as 别名]
 def handle(self, *args, **options):
     for domain in Domain.get_all():
         count = (SMSLog.count_by_domain(domain.name) +
             CallLog.count_by_domain(domain.name))
         if count > 0:
             if not domain.send_to_duplicated_case_numbers:
                 # if not True, explicitly set to False
                 print "Setting %s to False" % domain.name
                 domain.send_to_duplicated_case_numbers = False
                 domain.save()
         else:
             print "Setting %s to True" % domain.name
             domain.send_to_duplicated_case_numbers = True
             domain.save()
开发者ID:LifeCoaching,项目名称:commcare-hq,代码行数:16,代码来源:set_default_dup_number_option.py


注:本文中的corehq.apps.sms.models.CallLog.count_by_domain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。