kvesteri / sqlalchemy-continuum

Versioning extension for SQLAlchemy.
BSD 3-Clause "New" or "Revised" License
568 stars 128 forks source link

Rewrite TestFlaskPluginWithoutRequestContext #307

Closed marksteward closed 1 year ago

marksteward commented 1 year ago

I tried removing _app_ctx and _request_ctx and it broke this test because there's no login_manager.

It only worked in previous versions of flask-login because the code would avoid referencing current_user when outside a context. However, flask-login doesn't seem to think that's a scenario that can happen.

Presumably the test is for flask shell, but we should confirm that and be clearer about what our contract is.

rubencho commented 1 year ago

Hi @marksteward I think using flask's modules has_app_context and has_request_context the test can be solved and backwards compatibility with flask/flask-login

marksteward commented 1 year ago

I've rebased this in a7a6bd79 and will merge if tests pass.

marksteward commented 1 year ago

Merged, thanks for this @rubencho!