Merge branch 'feature/update-task-data' of github.com:sartography/cr-connect-workflow into feature/update-task-data

This commit is contained in:
Dan Funk 2020-01-23 15:35:51 -05:00
commit 45f2e52c86
3 changed files with 5 additions and 3 deletions

View File

@ -88,5 +88,6 @@ def get_file_info(file_id):
def delete_file(file_id):
session.query(FileDataModel).filter_by(id=file_id).delete()
session.query(FileDataModel).filter_by(file_model_id=file_id).delete()
session.query(FileModel).filter_by(id=file_id).delete()
session.commit()

View File

@ -74,7 +74,7 @@ class ExampleDataLoader:
continue
is_primary = filename.lower() == id + ".bpmn"
file_model = FileModel(name=filename, type=type, version="1",
file_model = FileModel(name=filename, type=type, content_type='text/xml', version="1",
last_updated=datetime.datetime.now(), primary=is_primary,
workflow_spec_id=id)
models.append(file_model)
@ -85,6 +85,7 @@ class ExampleDataLoader:
file.close()
return models
@staticmethod
def clean_db():
session.flush() # Clear out any transactions before deleting it all to avoid spurious errors.

View File

@ -93,7 +93,7 @@ class TestApiFiles(BaseTest, unittest.TestCase):
file = session.query(FileModel).filter_by(workflow_spec_id=spec.id).first()
rv = self.app.get('/v1.0/file/%i/data' % file.id)
self.assert_success(rv)
self.assertEquals("application/octet-stream", rv.content_type)
self.assertEqual("text/xml; charset=utf-8", rv.content_type)
self.assertTrue(rv.content_length > 1)
def test_delete_file(self):