These tests now require PB Mock because of the validate_study_id changes

This commit is contained in:
mike cullerton 2021-06-03 14:30:00 -04:00
parent 9a63ab9c4f
commit 37ba46fb8f
3 changed files with 5 additions and 2 deletions

View File

@ -5,7 +5,7 @@ from SpiffWorkflow.bpmn.PythonScriptEngine import Box
from tests.base_test import BaseTest from tests.base_test import BaseTest
from unittest.mock import patch from unittest.mock import patch
from crc import db, session from crc import app, session
from crc.api.common import ApiError from crc.api.common import ApiError
from crc.models.file import FileDataModel, FileModel from crc.models.file import FileDataModel, FileModel
from crc.models.protocol_builder import ProtocolBuilderRequiredDocumentSchema, ProtocolBuilderStudySchema from crc.models.protocol_builder import ProtocolBuilderRequiredDocumentSchema, ProtocolBuilderStudySchema
@ -30,6 +30,7 @@ class TestStudyDetailsScript(BaseTest):
self.task = self.processor.next_task() self.task = self.processor.next_task()
def test_study_info_returns_a_box_object_for_all_validations(self): def test_study_info_returns_a_box_object_for_all_validations(self):
app.config['PB_ENABLED'] = True
for option in StudyInfo.type_options: for option in StudyInfo.type_options:
data = StudyInfo().do_task_validate_only(self.task, self.study.id, self.workflow_model.id, option) data = StudyInfo().do_task_validate_only(self.task, self.study.id, self.workflow_model.id, option)
if isinstance(data, list): if isinstance(data, list):

View File

@ -1,12 +1,13 @@
from tests.base_test import BaseTest from tests.base_test import BaseTest
from crc import app
from crc.services.workflow_service import WorkflowService from crc.services.workflow_service import WorkflowService
from crc.api.common import ApiError from crc.api.common import ApiError
from jinja2.exceptions import TemplateSyntaxError
class TestValidateEndEvent(BaseTest): class TestValidateEndEvent(BaseTest):
def test_validate_end_event(self): def test_validate_end_event(self):
app.config['PB_ENABLED'] = True
error_string = """Error processing template for task EndEvent_1qvyxg7: expected token 'end of statement block', got '='""" error_string = """Error processing template for task EndEvent_1qvyxg7: expected token 'end of statement block', got '='"""

View File

@ -6,6 +6,7 @@ import json
class TestWorkflowInfiniteLoop(BaseTest): class TestWorkflowInfiniteLoop(BaseTest):
def test_workflow_infinite_loop(self): def test_workflow_infinite_loop(self):
app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
spec_model = self.load_test_spec('infinite_loop') spec_model = self.load_test_spec('infinite_loop')
rv = self.app.get('/v1.0/workflow-specification/%s/validate' % spec_model.id, headers=self.logged_in_headers()) rv = self.app.get('/v1.0/workflow-specification/%s/validate' % spec_model.id, headers=self.logged_in_headers())