mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-23 13:18:35 +00:00
Fixes for failing tests after removing current_user
from task data
This commit is contained in:
parent
f74afc3e18
commit
6911ab7aae
@ -135,7 +135,7 @@ class StudyService(object):
|
||||
files = (File.from_file_model(model, DocumentService.get_dictionary()) for model in files)
|
||||
study.files = list(files)
|
||||
last_time = sincetime("files", last_time)
|
||||
if process_categories and master_workflow_results:
|
||||
if process_categories and master_workflow_results is not None:
|
||||
if study.status != StudyStatus.abandoned:
|
||||
workflow_metas = []
|
||||
for category in study.categories:
|
||||
|
@ -103,6 +103,7 @@ class TestStudyApi(BaseTest):
|
||||
self.assertEqual('This workflow is locked', workflows[1].state_message)
|
||||
|
||||
def test_get_study_has_details_about_files(self):
|
||||
self.load_test_spec('empty_workflow', master_spec=True)
|
||||
|
||||
# Set up the study and attach a file to it.
|
||||
self.create_reference_document()
|
||||
@ -115,7 +116,7 @@ class TestStudyApi(BaseTest):
|
||||
name="anything.png", content_type="png",
|
||||
binary_data=b'1234', irb_doc_code=irb_code)
|
||||
|
||||
api_response = self.app.get('/v1.0/study/%i' % workflow.study_id,
|
||||
api_response = self.app.get('/v1.0/study/%i?update_status=True' % workflow.study_id,
|
||||
headers=self.logged_in_headers(), content_type="application/json")
|
||||
self.assert_success(api_response)
|
||||
study = StudySchema().loads(api_response.get_data(as_text=True))
|
||||
|
@ -347,18 +347,6 @@ class TestWorkflowProcessor(BaseTest):
|
||||
supervisor_task = processor.next_user_tasks()[0]
|
||||
self.assertEqual("supervisor", supervisor_task.task_spec.lane)
|
||||
|
||||
def test_run_master_spec_knows_about_current_user(self):
|
||||
"""Master spec should have access to the current user."""
|
||||
spec = self.load_test_spec('empty_workflow', "Master", master_spec=True)
|
||||
study = self.create_study()
|
||||
|
||||
# Make it seem like we are logged in
|
||||
g.user = UserModel.query.filter_by(uid=study.user_uid).first()
|
||||
g.token = 'my_fake_token'
|
||||
|
||||
results = WorkflowProcessor.run_master_spec(spec, study)
|
||||
self.assertIn('current_user', results.keys())
|
||||
|
||||
def test_ability_to_deserialize_old_workflows(self):
|
||||
workflow_model = self.create_workflow("random_fact")
|
||||
processor = WorkflowProcessor(workflow_model)
|
||||
|
Loading…
x
Reference in New Issue
Block a user