You have to mock out the protocol builder in tests that rely on it.

This commit is contained in:
Dan 2021-06-08 12:36:47 -04:00
parent 076d198fc6
commit 50ad42d3a8
1 changed files with 7 additions and 1 deletions

View File

@ -1,10 +1,16 @@
import json
from unittest.mock import patch
from tests.base_test import BaseTest from tests.base_test import BaseTest
from crc import app from crc import app
class TestGetStudyAssociateValidation(BaseTest): 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)
def test_get_study_associate_validation(self):
app.config['PB_ENABLED'] = True app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
workflow = self.create_workflow('get_study_associate') workflow = self.create_workflow('get_study_associate')