def METHOD_NAME():
    from casexml.apps.case.mock import CaseFactory
    factory = CaseFactory('domain')
    cases = []
    forms = []
    for i in range(3):
        case_id = uuid.uuid4().hex
        case_block = factory.get_case_block(case_id, case_type='case_type')
        form, [case] = factory.post_case_blocks([case_block.as_text()])
        cases.append(case)
        forms.append(form)
    case_ids = [case.case_id for case in cases]
    form_ids = [form.form_id for form in forms]
    try:
        yield form_ids, case_ids
    finally:
        XFormInstance.objects.hard_delete_forms('domain', form_ids)
        CommCareCase.objects.hard_delete_cases('domain', case_ids)