本文整理汇总了Python中eums.services.contact_service.ContactService.delete_rapid_pro_contact方法的典型用法代码示例。如果您正苦于以下问题:Python ContactService.delete_rapid_pro_contact方法的具体用法?Python ContactService.delete_rapid_pro_contact怎么用?Python ContactService.delete_rapid_pro_contact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eums.services.contact_service.ContactService
的用法示例。
在下文中一共展示了ContactService.delete_rapid_pro_contact方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_should_delete_rapid_pro_contact
# 需要导入模块: from eums.services.contact_service import ContactService [as 别名]
# 或者: from eums.services.contact_service.ContactService import delete_rapid_pro_contact [as 别名]
def test_should_delete_rapid_pro_contact(self):
phone = '+8618192235667'
url_delete_rapid_pro_contact = '%s?%s' % (settings.RAPIDPRO_URLS.get('CONTACTS'), urlencode({
'urns': 'tel:%s' % phone
}))
requests.delete = MagicMock(return_value=MagicMock(status_code=HTTP_204_NO_CONTENT))
response = ContactService.delete_rapid_pro_contact(phone)
requests.delete.assert_called_once_with(url_delete_rapid_pro_contact, headers=HEADER,
verify=settings.RAPIDPRO_SSL_VERIFY)
self.assertEqual(response.status_code, HTTP_204_NO_CONTENT)
示例2: test_should_not_delete_contact_when_rapid_pro_off
# 需要导入模块: from eums.services.contact_service import ContactService [as 别名]
# 或者: from eums.services.contact_service.ContactService import delete_rapid_pro_contact [as 别名]
def test_should_not_delete_contact_when_rapid_pro_off(self):
phone = '+8618192235667'
requests.delete = MagicMock(return_value=MagicMock(status_code=HTTP_204_NO_CONTENT))
ContactService.delete_rapid_pro_contact(phone)
self.assertFalse(requests.delete.called)