Merge branch 'varchar-category-id-483' of github.com:sartography/cr-connect-workflow into varchar-category-id-483

This commit is contained in:
Dan 2021-10-06 15:27:35 -04:00
commit c36a76a8bc
4 changed files with 5 additions and 5 deletions

View File

@ -127,7 +127,7 @@ class WorkflowMetadata(object):
def from_workflow(cls, workflow: WorkflowModel):
is_review = FileService.is_workflow_review(workflow.workflow_spec_id)
instance = cls(
id=workflow.workflow_spec_id,
id=workflow.id,
display_name=workflow.workflow_spec.display_name,
description=workflow.workflow_spec.description,
spec_version=workflow.spec_version(),

View File

@ -71,7 +71,7 @@ class TestStudyApi(BaseTest):
self.assertEqual(False, category['admin'])
self.assertEqual(1, len(category["workflows"]))
workflow = category["workflows"][0]
self.assertEqual("random_fact", workflow["id"])
self.assertEqual("Random Fact", workflow["display_name"])
self.assertEqual("optional", workflow["state"])
self.assertEqual("not_started", workflow["status"])
self.assertEqual(0, workflow["total_tasks"])

View File

@ -80,7 +80,7 @@ class TestStudyService(BaseTest):
self.assertEqual(0, workflow.completed_tasks)
# Initialize the Workflow with the workflow processor.
workflow_model = db.session.query(WorkflowModel).filter(WorkflowModel.workflow_spec_id == workflow.id).first()
workflow_model = db.session.query(WorkflowModel).filter(WorkflowModel.id == workflow.id).first()
processor = WorkflowProcessor(workflow_model)
processor.do_engine_steps()
@ -265,4 +265,4 @@ class TestStudyService(BaseTest):
self.assertEquals(1, len(associates))
assoc_json = StudyAssociatedSchema(many=True).dump(associates)
print(assoc_json)
self.assertEquals("Dan", assoc_json[0]['ldap_info']['given_name'])
self.assertEquals("Dan", assoc_json[0]['ldap_info']['given_name'])

View File

@ -94,7 +94,7 @@ class TestTasksApi(BaseTest):
json_data = json.loads(rv.get_data(as_text=True))
tasks = TaskEventSchema(many=True).load(json_data)
self.assertEqual(1, len(tasks))
self.assertEqual(workflow.workflow_spec_id, tasks[0]['workflow']['id'])
self.assertEqual(workflow.id, tasks[0]['workflow']['id'])
self.assertEqual(workflow.study.id, tasks[0]['study']['id'])
self.assertEqual("Test Workflows", tasks[0]['workflow']['category_display_name'])