本文整理汇总了Python中corehq.pillows.xform.XFormPillow.send_robust方法的典型用法代码示例。如果您正苦于以下问题:Python XFormPillow.send_robust方法的具体用法?Python XFormPillow.send_robust怎么用?Python XFormPillow.send_robust使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.pillows.xform.XFormPillow
的用法示例。
在下文中一共展示了XFormPillow.send_robust方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpClass
# 需要导入模块: from corehq.pillows.xform import XFormPillow [as 别名]
# 或者: from corehq.pillows.xform.XFormPillow import send_robust [as 别名]
def setUpClass(cls):
form_pillow = XFormPillow(online=False)
case_pillow = CasePillow(online=False)
cls.pillows = [form_pillow, case_pillow]
es = get_es_new()
with trap_extra_setup(ConnectionError, msg="cannot connect to elasicsearch"):
for pillow in cls.pillows:
completely_initialize_pillow_index(pillow)
initialize_index_and_mapping(es, GROUP_INDEX_INFO)
case = new_case(closed=True)
case_pillow.send_robust(case.to_json())
case = new_case(closed=False)
case_pillow.send_robust(case.to_json())
case = new_case(closed=True, owner_id="foo")
case_pillow.send_robust(case.to_json())
case = new_case(closed=False, owner_id="bar")
case_pillow.send_robust(case.to_json())
group = Group(_id=uuid.uuid4().hex, users=["foo", "bar"])
cls.group_id = group._id
send_to_elasticsearch('groups', group.to_json())
form = new_form(form={"meta": {"userID": None}})
form_pillow.send_robust(form.to_json())
form = new_form(form={"meta": {"userID": ""}})
form_pillow.send_robust(form.to_json())
form = new_form(form={"meta": {"deviceID": "abc"}})
form_pillow.send_robust(form.to_json())
form = new_form(form={"meta": {"userID": uuid.uuid4().hex}})
form_pillow.send_robust(form.to_json())
for pillow in cls.pillows:
pillow.get_es_new().indices.refresh(pillow.es_index)
es.indices.refresh(GROUP_INDEX_INFO.index)