From 50ee50e3c20f7eb58ce00ad63e0adf524f6398dd Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Tue, 14 Jan 2020 11:46:59 -0500 Subject: [PATCH] Fixes broken unit test --- tests/test_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index d8c21a37..24dae5ab 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -17,6 +17,7 @@ class TestStudy(BaseTest, unittest.TestCase): self.assertIsNotNone(study) def test_add_study(self): + self.load_example_data() study = { "id": 12345, "title": "Phase III Trial of Genuine People Personalities (GPP) Autonomous Intelligent Emotional Agents for Interstellar Spacecraft", @@ -30,9 +31,8 @@ class TestStudy(BaseTest, unittest.TestCase): content_type="application/json", data=json.dumps(StudyModelSchema().dump(study))) self.assert_success(rv) - db_study = session.query(StudyModel).first() + db_study = session.query(StudyModel).filter_by(id=12345).first() self.assertIsNotNone(db_study) - self.assertEqual(study["id"], db_study.id) self.assertEqual(study["title"], db_study.title) self.assertEqual(study["last_updated"], db_study.last_updated) self.assertEqual(study["protocol_builder_status"], db_study.protocol_builder_status) @@ -155,7 +155,7 @@ class TestStudy(BaseTest, unittest.TestCase): json_data = json.loads(rv.get_data(as_text=True)) workflow = WorkflowModelSchema().load(json_data, session=session) - # get the first from in the two form workflow. + # get the first form in the two form workflow. rv = self.app.get('/v1.0/workflow/%i/tasks' % workflow.id, content_type="application/json") json_data = json.loads(rv.get_data(as_text=True)) tasks = TaskSchema(many=True).load(json_data)