def _test_outbound_backend(self, backend, msg_text): from corehq.apps.sms.tests import BackendInvocationDoc self.domain_obj.default_sms_backend_id = backend._id self.domain_obj.save() send_sms(self.domain_obj.name, None, self.test_phone_number, msg_text) sms = SMS.objects.get( domain=self.domain_obj.name, direction='O', text=msg_text ) invoke_doc_id = '%s-%s' % (backend.__class__.__name__, json_format_datetime(sms.date)) invoke_doc = BackendInvocationDoc.get(invoke_doc_id) self.assertIsNotNone(invoke_doc)
def test_send_sms(self, msg, *args, **kwargs): from corehq.apps.sms.tests import BackendInvocationDoc doc = BackendInvocationDoc() doc._id = '%s-%s' % (self.__class__.__name__, json_format_datetime(msg.date)) doc.save()