当前位置: 首页>>代码示例>>Python>>正文


Python CommCareCase.get_with_rebuild方法代码示例

本文整理汇总了Python中casexml.apps.case.models.CommCareCase.get_with_rebuild方法的典型用法代码示例。如果您正苦于以下问题:Python CommCareCase.get_with_rebuild方法的具体用法?Python CommCareCase.get_with_rebuild怎么用?Python CommCareCase.get_with_rebuild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在casexml.apps.case.models.CommCareCase的用法示例。


在下文中一共展示了CommCareCase.get_with_rebuild方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testRebuildEmpty

# 需要导入模块: from casexml.apps.case.models import CommCareCase [as 别名]
# 或者: from casexml.apps.case.models.CommCareCase import get_with_rebuild [as 别名]
 def testRebuildEmpty(self):
     self.assertEqual(None, rebuild_case_from_forms('notarealid'))
     try:
         CommCareCase.get_with_rebuild('notarealid')
         self.fail('get with rebuild should still fail for unknown cases')
     except ResourceNotFound:
         pass
开发者ID:johan--,项目名称:commcare-hq,代码行数:9,代码来源:test_rebuild.py

示例2: testRebuildEmpty

# 需要导入模块: from casexml.apps.case.models import CommCareCase [as 别名]
# 或者: from casexml.apps.case.models.CommCareCase import get_with_rebuild [as 别名]
 def testRebuildEmpty(self):
     self.assertEqual(None, rebuild_case("notarealid"))
     try:
         CommCareCase.get_with_rebuild("notarealid")
         self.fail("get with rebuild should still fail for unknown cases")
     except ResourceNotFound:
         pass
开发者ID:puttarajubr,项目名称:commcare-hq,代码行数:9,代码来源:test_rebuild.py

示例3: _get_case

# 需要导入模块: from casexml.apps.case.models import CommCareCase [as 别名]
# 或者: from casexml.apps.case.models.CommCareCase import get_with_rebuild [as 别名]
 def _get_case(case_id):
     if case_id in self._all_relevant_cases:
         return self._all_relevant_cases[case_id]
     else:
         case = CommCareCase.get_with_rebuild(case_id)
         self._all_relevant_cases[case_id] = case
         return case
开发者ID:dimagi,项目名称:casexml,代码行数:9,代码来源:caselogic.py

示例4: testRebuildCreateCase

# 需要导入模块: from casexml.apps.case.models import CommCareCase [as 别名]
# 或者: from casexml.apps.case.models.CommCareCase import get_with_rebuild [as 别名]
    def testRebuildCreateCase(self):
        case_id = _post_util(create=True)
        _post_util(case_id=case_id, p1='p1', p2='p2')

        # delete initial case
        case = CommCareCase.get(case_id)
        case.delete()

        case = rebuild_case_from_forms(case_id)
        self.assertEqual(case.p1, 'p1')
        self.assertEqual(case.p2, 'p2')
        self.assertEqual(2, len(primary_actions(case)))  # create + update

        case.delete()
        try:
            CommCareCase.get(case_id)
            self.fail('get should fail on deleted cases')
        except ResourceNotFound:
            pass

        case = CommCareCase.get_with_rebuild(case_id)
        self.assertEqual(case.p1, 'p1')
        self.assertEqual(case.p2, 'p2')
开发者ID:johan--,项目名称:commcare-hq,代码行数:25,代码来源:test_rebuild.py

示例5: testRebuildCreateCase

# 需要导入模块: from casexml.apps.case.models import CommCareCase [as 别名]
# 或者: from casexml.apps.case.models.CommCareCase import get_with_rebuild [as 别名]
    def testRebuildCreateCase(self):
        case_id = post_util(create=True)
        post_util(case_id=case_id, p1="p1", p2="p2")

        # delete initial case
        case = CommCareCase.get(case_id)
        case.delete()

        case = rebuild_case(case_id)
        self.assertEqual(case.p1, "p1")
        self.assertEqual(case.p2, "p2")
        self.assertEqual(2, len(primary_actions(case)))  # create + update

        case.delete()
        try:
            CommCareCase.get(case_id)
            self.fail("get should fail on deleted cases")
        except ResourceNotFound:
            pass

        case = CommCareCase.get_with_rebuild(case_id)
        self.assertEqual(case.p1, "p1")
        self.assertEqual(case.p2, "p2")
开发者ID:puttarajubr,项目名称:commcare-hq,代码行数:25,代码来源:test_rebuild.py


注:本文中的casexml.apps.case.models.CommCareCase.get_with_rebuild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。