本文整理汇总了Python中eums.services.contact_service.ContactService.delete方法的典型用法代码示例。如果您正苦于以下问题:Python ContactService.delete方法的具体用法?Python ContactService.delete怎么用?Python ContactService.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eums.services.contact_service.ContactService
的用法示例。
在下文中一共展示了ContactService.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_should_delete_contact
# 需要导入模块: from eums.services.contact_service import ContactService [as 别名]
# 或者: from eums.services.contact_service.ContactService import delete [as 别名]
def test_should_delete_contact(self):
requests.delete = MagicMock(return_value=MagicMock(status_code=204))
response = ContactService.delete(CONTACT.get('_id'))
requests.delete.assert_called_once_with(url='%s%s' % (settings.CONTACTS_SERVICE_URL, CONTACT['_id']))
self.assertEqual(response, 204)
示例2: delete
# 需要导入模块: from eums.services.contact_service import ContactService [as 别名]
# 或者: from eums.services.contact_service.ContactService import delete [as 别名]
def delete(self, request, pk):
current_contact = self.get_object(pk)
response_code = ContactService.delete(pk)
ContactEndpoint.__delete_rapid_pro_contact(current_contact.get('phone'))
return Response(status=response_code)