The reference document is already created in load_example_data

This lead to a failing test after cleaning up the way we add/update files
This commit is contained in:
mike cullerton 2022-01-12 15:07:57 -05:00
parent b99ed73951
commit 88a8c96bd6
11 changed files with 0 additions and 32 deletions

View File

@ -56,7 +56,6 @@ class TestFileService(BaseTest):
def test_add_file_from_task_increments_version_and_replaces_on_subsequent_add(self): def test_add_file_from_task_increments_version_and_replaces_on_subsequent_add(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('file_upload_form') workflow = self.create_workflow('file_upload_form')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()
@ -81,7 +80,6 @@ class TestFileService(BaseTest):
def test_add_file_from_form_increments_version_and_replaces_on_subsequent_add_with_same_name(self): def test_add_file_from_form_increments_version_and_replaces_on_subsequent_add_with_same_name(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('file_upload_form') workflow = self.create_workflow('file_upload_form')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()
@ -100,7 +98,6 @@ class TestFileService(BaseTest):
def test_replace_archive_file_unarchives_the_file_and_updates(self): def test_replace_archive_file_unarchives_the_file_and_updates(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('file_upload_form') workflow = self.create_workflow('file_upload_form')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()
@ -140,7 +137,6 @@ class TestFileService(BaseTest):
def test_add_file_from_form_allows_multiple_files_with_different_names(self): def test_add_file_from_form_allows_multiple_files_with_different_names(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('file_upload_form') workflow = self.create_workflow('file_upload_form')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()
@ -164,7 +160,6 @@ class TestFileService(BaseTest):
mock_github.return_value = FakeGithub() mock_github.return_value = FakeGithub()
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('file_upload_form') workflow = self.create_workflow('file_upload_form')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()
@ -188,7 +183,6 @@ class TestFileService(BaseTest):
mock_github.return_value = FakeGithubCreates() mock_github.return_value = FakeGithubCreates()
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('file_upload_form') workflow = self.create_workflow('file_upload_form')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()
@ -207,7 +201,6 @@ class TestFileService(BaseTest):
mock_github.return_value = FakeGithub() mock_github.return_value = FakeGithub()
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('file_upload_form') workflow = self.create_workflow('file_upload_form')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()

View File

@ -84,7 +84,6 @@ class TestFilesApi(BaseTest):
def test_archive_file_no_longer_shows_up(self): def test_archive_file_no_longer_shows_up(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('file_upload_form') workflow = self.create_workflow('file_upload_form')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
processor.do_engine_steps() processor.do_engine_steps()
@ -170,7 +169,6 @@ class TestFilesApi(BaseTest):
def test_list_reference_files(self): def test_list_reference_files(self):
ExampleDataLoader.clean_db() ExampleDataLoader.clean_db()
# self.create_reference_document()
file_name = DocumentService.DOCUMENT_LIST file_name = DocumentService.DOCUMENT_LIST
filepath = os.path.join(app.root_path, 'static', 'reference', 'irb_documents.xlsx') filepath = os.path.join(app.root_path, 'static', 'reference', 'irb_documents.xlsx')
@ -192,7 +190,6 @@ class TestFilesApi(BaseTest):
def test_update_file_info(self): def test_update_file_info(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
file: FileModel = session.query(FileModel).filter(FileModel.is_reference==False).first() file: FileModel = session.query(FileModel).filter(FileModel.is_reference==False).first()
file.name = "silly_new_name.bpmn" file.name = "silly_new_name.bpmn"
@ -206,7 +203,6 @@ class TestFilesApi(BaseTest):
def test_load_valid_url_for_files(self): def test_load_valid_url_for_files(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
file: FileModel = session.query(FileModel).filter(FileModel.is_reference == False).first() file: FileModel = session.query(FileModel).filter(FileModel.is_reference == False).first()
rv = self.app.get('/v1.0/file/%i' % file.id, content_type="application/json", headers=self.logged_in_headers()) rv = self.app.get('/v1.0/file/%i' % file.id, content_type="application/json", headers=self.logged_in_headers())
self.assert_success(rv) self.assert_success(rv)

View File

@ -13,7 +13,6 @@ class TestLdapLookupScript(BaseTest):
def test_get_existing_user_details(self): def test_get_existing_user_details(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('empty_workflow') workflow = self.create_workflow('empty_workflow')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()
@ -34,7 +33,6 @@ class TestLdapLookupScript(BaseTest):
def test_get_invalid_user_details(self): def test_get_invalid_user_details(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('empty_workflow') workflow = self.create_workflow('empty_workflow')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()
@ -49,7 +47,6 @@ class TestLdapLookupScript(BaseTest):
def test_get_current_user_details(self): def test_get_current_user_details(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('empty_workflow') workflow = self.create_workflow('empty_workflow')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()

View File

@ -78,7 +78,6 @@ class TestStudyApi(BaseTest):
# Set up the study and attach a file to it. # Set up the study and attach a file to it.
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('file_upload_form') workflow = self.create_workflow('file_upload_form')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()

View File

@ -42,7 +42,6 @@ class TestSudySponsorsScript(BaseTest):
app.config['PB_ENABLED'] = True app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("study_sponsors_associate") workflow_spec_model = self.load_test_spec("study_sponsors_associate")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -80,7 +79,6 @@ class TestSudySponsorsScript(BaseTest):
app.config['PB_ENABLED'] = True app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("study_sponsors_associate_fail") workflow_spec_model = self.load_test_spec("study_sponsors_associate_fail")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -98,7 +96,6 @@ class TestSudySponsorsScript(BaseTest):
app.config['PB_ENABLED'] = True app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("study_sponsors_associate_switch_user") workflow_spec_model = self.load_test_spec("study_sponsors_associate_switch_user")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -120,7 +117,6 @@ class TestSudySponsorsScript(BaseTest):
app.config['PB_ENABLED'] = True app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("study_sponsors_associate_switch_user") workflow_spec_model = self.load_test_spec("study_sponsors_associate_switch_user")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -152,7 +148,6 @@ class TestSudySponsorsScript(BaseTest):
app.config['PB_ENABLED'] = True app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("study_sponsors_associate_switch_user") workflow_spec_model = self.load_test_spec("study_sponsors_associate_switch_user")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -181,7 +176,6 @@ class TestSudySponsorsScript(BaseTest):
app.config['PB_ENABLED'] = True app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("study_sponsors_associates_delete") workflow_spec_model = self.load_test_spec("study_sponsors_associates_delete")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)

View File

@ -39,7 +39,6 @@ class TestSudySponsorsScript(BaseTest):
app.config['PB_ENABLED'] = True app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("study_sponsors_data_store") workflow_spec_model = self.load_test_spec("study_sponsors_data_store")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)

View File

@ -18,7 +18,6 @@ class TestStudyDetailsScript(BaseTest):
def setUp(self): def setUp(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
self.study = session.query(StudyModel).first() self.study = session.query(StudyModel).first()
self.workflow_spec_model = self.load_test_spec("two_forms") self.workflow_spec_model = self.load_test_spec("two_forms")
self.workflow_model = StudyService._create_workflow_model(self.study, self.workflow_spec_model) self.workflow_model = StudyService._create_workflow_model(self.study, self.workflow_spec_model)

View File

@ -34,7 +34,6 @@ class TestStudyDetailsDocumentsScript(BaseTest):
mock_get.return_value.text = self.protocol_builder_response('required_docs.json') mock_get.return_value.text = self.protocol_builder_response('required_docs.json')
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("two_forms") workflow_spec_model = self.load_test_spec("two_forms")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -60,7 +59,6 @@ class TestStudyDetailsDocumentsScript(BaseTest):
mock_get.return_value.text = self.protocol_builder_response('required_docs.json') mock_get.return_value.text = self.protocol_builder_response('required_docs.json')
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("two_forms") workflow_spec_model = self.load_test_spec("two_forms")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -82,7 +80,6 @@ class TestStudyDetailsDocumentsScript(BaseTest):
mock_get.return_value.ok = True mock_get.return_value.ok = True
mock_get.return_value.text = self.protocol_builder_response('required_docs.json') mock_get.return_value.text = self.protocol_builder_response('required_docs.json')
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("two_forms") workflow_spec_model = self.load_test_spec("two_forms")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -98,7 +95,6 @@ class TestStudyDetailsDocumentsScript(BaseTest):
mock_get.return_value.ok = True mock_get.return_value.ok = True
mock_get.return_value.text = self.protocol_builder_response('required_docs.json') mock_get.return_value.text = self.protocol_builder_response('required_docs.json')
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("two_forms") workflow_spec_model = self.load_test_spec("two_forms")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -120,7 +116,6 @@ class TestStudyDetailsDocumentsScript(BaseTest):
mock_get.return_value.ok = True mock_get.return_value.ok = True
mock_get.return_value.text = self.protocol_builder_response('required_docs.json') mock_get.return_value.text = self.protocol_builder_response('required_docs.json')
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("two_forms") workflow_spec_model = self.load_test_spec("two_forms")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)
@ -143,7 +138,6 @@ class TestStudyDetailsDocumentsScript(BaseTest):
mock_get.return_value.ok = True mock_get.return_value.ok = True
mock_get.return_value.text = self.protocol_builder_response('required_docs.json') mock_get.return_value.text = self.protocol_builder_response('required_docs.json')
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("two_forms") workflow_spec_model = self.load_test_spec("two_forms")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)

View File

@ -35,7 +35,6 @@ class TestSudySponsorsScript(BaseTest):
app.config['PB_ENABLED'] = True app.config['PB_ENABLED'] = True
self.load_example_data() self.load_example_data()
# self.create_reference_document()
study = session.query(StudyModel).first() study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("study_sponsors") workflow_spec_model = self.load_test_spec("study_sponsors")
workflow_model = StudyService._create_workflow_model(study, workflow_spec_model) workflow_model = StudyService._create_workflow_model(study, workflow_spec_model)

View File

@ -9,7 +9,6 @@ class TestUpdateStudyScript(BaseTest):
def test_do_task(self): def test_do_task(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
workflow = self.create_workflow('empty_workflow') workflow = self.create_workflow('empty_workflow')
processor = WorkflowProcessor(workflow) processor = WorkflowProcessor(workflow)
task = processor.next_task() task = processor.next_task()

View File

@ -14,7 +14,6 @@ class TestFileDatastore(BaseTest):
def test_file_datastore_workflow(self): def test_file_datastore_workflow(self):
self.load_example_data() self.load_example_data()
# self.create_reference_document()
# we need to create a file with an IRB code # we need to create a file with an IRB code
# for this study # for this study
workflow = self.create_workflow('file_data_store') workflow = self.create_workflow('file_data_store')