本文整理汇总了Python中dialer_cdr.models.Callrequest.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Callrequest.delete方法的具体用法?Python Callrequest.delete怎么用?Python Callrequest.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialer_cdr.models.Callrequest
的用法示例。
在下文中一共展示了Callrequest.delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DialerCdrModel
# 需要导入模块: from dialer_cdr.models import Callrequest [as 别名]
# 或者: from dialer_cdr.models.Callrequest import delete [as 别名]
class DialerCdrModel(TestCase):
"""Test Callrequest, VoIPCall models"""
fixtures = ['auth_user.json', 'gateway.json', 'dialer_setting.json',
'user_profile.json', 'phonebook.json', 'contact.json',
'dnc_list.json', 'dnc_contact.json', 'survey.json',
'campaign.json', 'subscriber.json', 'callrequest.json', 'voipcall.json',
'user_profile.json']
def setUp(self):
self.user = User.objects.get(username='admin')
VoipSearchForm(self.user)
try:
content_type_id = ContentType.objects.get(model='survey').id
except:
content_type_id = 1
# Callrequest model
self.callrequest = Callrequest(
call_type=1,
status=1,
user=self.user,
phone_number='123456',
subscriber_id=1,
campaign_id=1,
aleg_gateway_id=1,
content_type_id=content_type_id,
object_id=1,
)
self.callrequest.save()
# VoIPCall model
self.voipcall = VoIPCall(
user=self.user,
used_gateway_id=1,
callrequest=self.callrequest,
callid='Top Gun',
phone_number='123456',
leg_type=1,
duration=20,
)
self.voipcall.save()
self.assertEqual(self.voipcall.__unicode__(), u'2 - Top Gun')
# Test mgt command
call_command("create_callrequest_cdr", "1|1")
call_command("create_callrequest_cdr", "3|1")
def test_name(self):
self.assertEqual(self.callrequest.phone_number, "123456")
#self.assertEqual(self.callrequest.__unicode__(), u'Top Gun')
self.assertEqual(self.voipcall.phone_number, "123456")
Callrequest.objects.get_pending_callrequest()
self.voipcall.destination_name()
self.voipcall.duration = ''
self.voipcall.min_duration()
self.voipcall.duration = 12
self.voipcall.min_duration()
def teardown(self):
self.callrequest.delete()
self.voipcall.delete()