From ea4e382f062e5b67685ccd34561c65aebc140e05 Mon Sep 17 00:00:00 2001 From: alicia pritchett Date: Wed, 6 Oct 2021 15:24:58 -0400 Subject: [PATCH] Fixing some tests --- tests/study/test_study_api.py | 2 +- tests/study/test_study_service.py | 4 ++-- tests/test_user_roles.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/study/test_study_api.py b/tests/study/test_study_api.py index c7387b24..ca364618 100644 --- a/tests/study/test_study_api.py +++ b/tests/study/test_study_api.py @@ -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"]) diff --git a/tests/study/test_study_service.py b/tests/study/test_study_service.py index 95e00b29..f0e76a14 100644 --- a/tests/study/test_study_service.py +++ b/tests/study/test_study_service.py @@ -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']) \ No newline at end of file + self.assertEquals("Dan", assoc_json[0]['ldap_info']['given_name']) diff --git a/tests/test_user_roles.py b/tests/test_user_roles.py index a17a577d..9d473fec 100644 --- a/tests/test_user_roles.py +++ b/tests/test_user_roles.py @@ -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'])