2021-06-08 16:36:47 +00:00
|
|
|
import json
|
|
|
|
from unittest.mock import patch
|
|
|
|
|
2021-06-04 15:45:51 +00:00
|
|
|
from tests.base_test import BaseTest
|
|
|
|
from crc import app
|
|
|
|
|
|
|
|
|
|
|
|
class TestGetStudyAssociateValidation(BaseTest):
|
2021-06-08 16:36:47 +00:00
|
|
|
@patch('crc.services.protocol_builder.ProtocolBuilderService.get_investigators')
|
|
|
|
def test_get_study_associate_validation(self, mock):
|
|
|
|
response = self.protocol_builder_response('investigators.json')
|
|
|
|
mock.return_value = json.loads(response)
|
2021-06-04 15:45:51 +00:00
|
|
|
|
2021-06-08 16:18:16 +00:00
|
|
|
app.config['PB_ENABLED'] = True
|
2021-06-04 15:45:51 +00:00
|
|
|
self.load_example_data()
|
|
|
|
workflow = self.create_workflow('get_study_associate')
|
|
|
|
rv = self.app.get('/v1.0/workflow-specification/%s/validate' % workflow.workflow_spec_id,
|
|
|
|
headers=self.logged_in_headers())
|
|
|
|
self.assertEqual(0, len(rv.json))
|