本文整理汇总了Python中corehq.form_processor.interfaces.FormProcessorInterface.update_case_properties方法的典型用法代码示例。如果您正苦于以下问题:Python FormProcessorInterface.update_case_properties方法的具体用法?Python FormProcessorInterface.update_case_properties怎么用?Python FormProcessorInterface.update_case_properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.form_processor.interfaces.FormProcessorInterface
的用法示例。
在下文中一共展示了FormProcessorInterface.update_case_properties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSubmitToDeletedCase
# 需要导入模块: from corehq.form_processor.interfaces import FormProcessorInterface [as 别名]
# 或者: from corehq.form_processor.interfaces.FormProcessorInterface import update_case_properties [as 别名]
def testSubmitToDeletedCase(self):
# submitting to a deleted case should succeed and affect the case
case_id = 'immagetdeleted'
deleted_doc_type = 'CommCareCase-Deleted'
[xform, [case]] = FormProcessorInterface.post_case_blocks([
CaseBlock(create=True, case_id=case_id, user_id='whatever',
update={'foo': 'bar'}).as_xml()
])
self.assertEqual('bar', case.foo)
case = FormProcessorInterface.update_case_properties(case, doc_type=deleted_doc_type)
self.assertEqual(deleted_doc_type, case.doc_type)
[xform, [case]] = FormProcessorInterface.post_case_blocks([
CaseBlock(create=False, case_id=case_id, user_id='whatever',
update={'foo': 'not_bar'}).as_xml()
])
self.assertEqual('not_bar', case.foo)
self.assertEqual(deleted_doc_type, case.doc_type)