Fix Session expiry for tests
This is likely not an issue for production (since each request will get its own SQLAlchemy session), but `scoped_session` results in the tests reuseing the same Session across tests. The tests rely on the default session expiry behavior.
This commit is contained in:
parent
509332e9cc
commit
43f329badf
1 changed files with 1 additions and 0 deletions
|
@ -238,6 +238,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
||||||
g.db.expire_on_commit = False
|
g.db.expire_on_commit = False
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
g.db.expire_on_commit = True
|
||||||
|
|
||||||
if request.headers.get("Authorization"): return post.json
|
if request.headers.get("Authorization"): return post.json
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue