Skip to content

Commit

Permalink
chore(flask-vulnerability): fix test_migrate_acls
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Sep 17, 2019
1 parent a323f3e commit 3c76a17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions indexd/bulk/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json

import flask
from flask import Response

from indexd.errors import UserError
from indexd.index.drivers.alchemy import IndexRecord, IndexRecordUrl
Expand Down Expand Up @@ -44,7 +43,7 @@ def bulk_get_documents():
query = query.filter(IndexRecord.did.in_(ids))

docs = [q.to_document_dict() for q in query]
return Response(json.dumps(docs), 200, mimetype="application/json")
return flask.Response(json.dumps(docs), 200, mimetype="application/json")


@blueprint.record
Expand Down
7 changes: 6 additions & 1 deletion tests/test_schema_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,17 @@ def test_migrate_acls(client, user):
"hashes": {"md5": "8b9942cf415384b27cadf1f4d2d682e5"},
}

# create the record
res = client.post("/index/", json=data, headers=user)
rec = res.json
assert res.status_code == 200

# migrate
with settings["config"]["INDEX"]["driver"].session as session:
migrate_7(session)
res = client.get(rec["did"])

# check that the record has been migrated
res = client.get("/" + rec["did"])
rec = res.json
assert res.status_code == 200
assert rec["acl"] == ["a", "b"]
Expand Down

0 comments on commit 3c76a17

Please sign in to comment.