cr-connect-workflow/tests/scripts/test_get_study_associate_va...

20 lines
753 B
Python
Raw Normal View History

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):
@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
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))