lepture / authlib

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
https://authlib.org/
BSD 3-Clause "New" or "Revised" License
4.45k stars 445 forks source link

remove SQLAlchemy LegacyAPIWarning from unit tests #574

Closed azmeuk closed 12 months ago

azmeuk commented 12 months ago

This prevents these warnings to pop when running the unit tests:

LegacyAPIWarning: The Query.get() method is considered legacy as of the 1.x series of SQLAlchemy and becomes a legacy construct in 2.0. The method is now available as Session.get() (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
    grant_user = User.query.get(int(user_id))

Also, the documentation use more framework-generic examples (User.query.get becomes User.get)