本文整理汇总了Python中casexml.apps.case.mock.CaseFactory.delete方法的典型用法代码示例。如果您正苦于以下问题:Python CaseFactory.delete方法的具体用法?Python CaseFactory.delete怎么用?Python CaseFactory.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类casexml.apps.case.mock.CaseFactory
的用法示例。
在下文中一共展示了CaseFactory.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_case
# 需要导入模块: from casexml.apps.case.mock import CaseFactory [as 别名]
# 或者: from casexml.apps.case.mock.CaseFactory import delete [as 别名]
def create_case(domain, case_type, **kwargs):
case = CaseFactory(domain).create_case(case_type=case_type, **kwargs)
try:
yield case
finally:
if should_use_sql_backend(domain):
CaseAccessorSQL.hard_delete_cases(domain, [case.case_id])
else:
case.delete()
示例2: _with_case
# 需要导入模块: from casexml.apps.case.mock import CaseFactory [as 别名]
# 或者: from casexml.apps.case.mock.CaseFactory import delete [as 别名]
def _with_case(domain, case_type, last_modified):
with drop_connected_signals(case_post_save):
case = CaseFactory(domain).create_case(case_type=case_type)
_update_case(domain, case.case_id, last_modified)
accessors = CaseAccessors(domain)
case = accessors.get_case(case.case_id)
try:
yield case
finally:
if should_use_sql_backend(domain):
CaseAccessorSQL.hard_delete_cases(domain, [case.case_id])
else:
case.delete()