本文整理汇总了Python中corehq.form_processor.backends.sql.dbaccessors.FormAccessorSQL.get_attachments方法的典型用法代码示例。如果您正苦于以下问题:Python FormAccessorSQL.get_attachments方法的具体用法?Python FormAccessorSQL.get_attachments怎么用?Python FormAccessorSQL.get_attachments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.form_processor.backends.sql.dbaccessors.FormAccessorSQL
的用法示例。
在下文中一共展示了FormAccessorSQL.get_attachments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_save_new_form
# 需要导入模块: from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL [as 别名]
# 或者: from corehq.form_processor.backends.sql.dbaccessors.FormAccessorSQL import get_attachments [as 别名]
def test_save_new_form(self):
unsaved_form = create_form_for_test(DOMAIN, save=False)
FormAccessorSQL.save_new_form(unsaved_form)
self.assertTrue(unsaved_form.is_saved())
attachments = FormAccessorSQL.get_attachments(unsaved_form.form_id)
self.assertEqual(1, len(attachments))
示例2: test_save_form_db_error
# 需要导入模块: from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL [as 别名]
# 或者: from corehq.form_processor.backends.sql.dbaccessors.FormAccessorSQL import get_attachments [as 别名]
def test_save_form_db_error(self):
form = create_form_for_test(DOMAIN)
dup_form = create_form_for_test(DOMAIN, save=False)
dup_form.form_id = form.form_id
try:
FormAccessorSQL.save_new_form(dup_form)
except Exception:
dup_form.form_id = uuid.uuid4().hex
FormAccessorSQL.save_new_form(dup_form)
else:
self.fail("saving dup form didn't raise an exception")
attachments = FormAccessorSQL.get_attachments(dup_form.form_id)
self.assertEqual(1, len(attachments))
示例3: _get_attachments_from_db
# 需要导入模块: from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL [as 别名]
# 或者: from corehq.form_processor.backends.sql.dbaccessors.FormAccessorSQL import get_attachments [as 别名]
def _get_attachments_from_db(self):
from corehq.form_processor.backends.sql.dbaccessors import FormAccessorSQL
return FormAccessorSQL.get_attachments(self.form_id)