本文整理汇总了Python中app.models.project.Project.status方法的典型用法代码示例。如果您正苦于以下问题:Python Project.status方法的具体用法?Python Project.status怎么用?Python Project.status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.models.project.Project
的用法示例。
在下文中一共展示了Project.status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_process_processed_files
# 需要导入模块: from app.models.project import Project [as 别名]
# 或者: from app.models.project.Project import status [as 别名]
def test_process_processed_files(self):
"""Make sure that a project that's being processed or already
processed can't be processed again.
"""
project1 = Project(name="foo", path="/test-path",
status=Project.STATUS_PREPROCESSING)
rel = self.user.add_project(project1, role=ProjectsUsers.ROLE_ADMIN)
document_file = DocumentFile(path="foo/foo.xml")
structure_file = StructureFile(path="foo/foo.json")
project1.document_files = [document_file]
project1.structure_files = [structure_file]
project1.save()
data = {
"struc_id": structure_file.id,
}
result = self.client.post(application.config["PROCESS_ROUTE"] + str(project1.id), data=data)
assert '"status": "OK"' not in result.data
project1.status = Project.STATUS_DONE
project1.save()
result = self.client.post(application.config["PROCESS_ROUTE"] + str(project1.id), data=data)
assert '"status": "OK"' not in result.data