本文整理匯總了Python中corehq.apps.sms.mixin.MobileBackend.delete方法的典型用法代碼示例。如果您正苦於以下問題:Python MobileBackend.delete方法的具體用法?Python MobileBackend.delete怎麽用?Python MobileBackend.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類corehq.apps.sms.mixin.MobileBackend
的用法示例。
在下文中一共展示了MobileBackend.delete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: KooKooTestCase
# 需要導入模塊: from corehq.apps.sms.mixin import MobileBackend [as 別名]
# 或者: from corehq.apps.sms.mixin.MobileBackend import delete [as 別名]
#.........這裏部分代碼省略.........
resp = self.kookoo_in({
"cid": "0001",
"sid": kookoo_session_id,
"event": "GotDTMF",
"data": "2",
})
self.assertEqual(resp, '<response sid="%s"><collectdtmf l="1" o="3000">'
'<playtext>Did you remember to take your meds today? Press 1 for yes, 2 for no.'
'</playtext></collectdtmf></response>' % kookoo_session_id)
resp = self.kookoo_in({
"cid": "0001",
"sid": kookoo_session_id,
"event": "GotDTMF",
"data": "1",
})
self.assertEqual(resp, '<response sid="%s"><hangup/></response>' % kookoo_session_id)
self.kookoo_finished({
"sid": kookoo_session_id,
"status": "answered",
"duration": "20",
})
call1 = CallLog.get(call1._id)
self.assertTrue(call.answered)
form = self.get_last_form_submission()
self.assertFormQuestionEquals(form, "how_feel", "2")
self.assertFormQuestionEquals(form, "take_meds", "1")
self.assertEqual(form.form["meta"]["userID"], self.user1._id)
case = CommCareCase.get(self.case._id)
self.assertCasePropertyEquals(case, "how_feel", "2")
self.assertCasePropertyEquals(case, "take_meds", "1")
self.assertEqual(case.user_id, self.user1._id)
old_call1 = call1
old_call2 = call2
CaseReminderHandler.now = datetime(2014, 6, 24, 13, 0)
CaseReminderHandler.fire_reminders()
reminder = self.reminder2.get_reminder(self.case)
self.assertEquals(reminder.next_fire, datetime(2014, 6, 25, 12, 0))
call1 = self.get_last_outbound_call(self.user1)
# No new call for user1 since it was already answered
self.assertEqual(call1._id, old_call1._id)
call2 = self.get_last_outbound_call(self.user2)
self.assertTrue(call2.use_precached_first_response)
self.assertNotEqual(call2._id, old_call2._id)
kookoo_session_id = call2.gateway_session_id[7:]
resp = self.kookoo_in({
"cid": "0002",
"sid": kookoo_session_id,
"event": "NewCall",
})
self.assertEqual(resp, '<response sid="%s"><collectdtmf l="1" o="3000">'
'<playtext>How do you feel today? Press 1 for good, 2 for bad.'
'</playtext></collectdtmf></response>' % kookoo_session_id)
resp = self.kookoo_in({
"cid": "0002",
"sid": kookoo_session_id,
"event": "GotDTMF",
"data": "1",
})
self.assertEqual(resp, '<response sid="%s"><collectdtmf l="1" o="3000">'
'<playtext>Did you remember to take your meds today? Press 1 for yes, 2 for no.'
'</playtext></collectdtmf></response>' % kookoo_session_id)
resp = self.kookoo_in({
"cid": "0002",
"sid": kookoo_session_id,
"event": "GotDTMF",
"data": "2",
})
self.assertEqual(resp, '<response sid="%s"><hangup/></response>' % kookoo_session_id)
self.kookoo_finished({
"sid": kookoo_session_id,
"status": "answered",
"duration": "20",
})
call2 = CallLog.get(call2._id)
self.assertTrue(call.answered)
form = self.get_last_form_submission()
self.assertFormQuestionEquals(form, "how_feel", "1")
self.assertFormQuestionEquals(form, "take_meds", "2")
self.assertEqual(form.form["meta"]["userID"], self.user2._id)
case = CommCareCase.get(self.case._id)
self.assertCasePropertyEquals(case, "how_feel", "1")
self.assertCasePropertyEquals(case, "take_meds", "2")
self.assertEqual(case.user_id, self.user2._id)
def tearDown(self):
self.ivr_backend.delete()
super(KooKooTestCase, self).tearDown()