Final test for study_info script

This commit is contained in:
mike cullerton 2021-05-14 13:10:06 -04:00
parent b0fcb09581
commit a53e2db223
1 changed files with 11 additions and 7 deletions

View File

@ -33,13 +33,17 @@ class TestStudyInfoScript(BaseTest):
self.assertEqual(study_info['primary_investigator_id'], second_task.data['info']['primary_investigator_id']) self.assertEqual(study_info['primary_investigator_id'], second_task.data['info']['primary_investigator_id'])
self.assertIn(study_info['title'], second_task.documentation) self.assertIn(study_info['title'], second_task.documentation)
def test_info_script_investigators(self): @patch('crc.services.protocol_builder.requests.get')
# We don't have a test for this yet def test_info_script_investigators(self, mock_get):
# I believe we just need to set up some test data. app.config['PB_ENABLED'] = True
# study_info, second_task = self.do_work(info_type='investigators') mock_get.return_value.ok = True
# if study_info: mock_get.return_value.text = self.protocol_builder_response('investigators.json')
# # TODO: add investigators with user_ids that are not None response = ProtocolBuilderService.get_investigators(self.test_study_id)
pass study_info, second_task = self.do_work(info_type='investigators')
for i in range(len(response)):
r = response[i]
s = second_task.data['info'][response[i]['INVESTIGATORTYPE']]
self.assertEqual(r['INVESTIGATORTYPEFULL'], s['label'])
def test_info_script_roles(self): def test_info_script_roles(self):
study_info, second_task = self.do_work(info_type='roles') study_info, second_task = self.do_work(info_type='roles')