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:
TLSM 2023-02-07 07:04:02 -05:00
parent 509332e9cc
commit 43f329badf
No known key found for this signature in database
GPG key ID: E745A82778055C7E

View file

@ -238,6 +238,7 @@ def post_id(pid, anything=None, v=None, sub=None):
g.db.expire_on_commit = False
g.db.add(post)
g.db.commit()
g.db.expire_on_commit = True
if request.headers.get("Authorization"): return post.json
else: