Skip to content

Commit 615462a

Browse files
committed
Fix test cases for contrib oauth2
1 parent b33cd44 commit 615462a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/oauth2/server.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
from flask.ext.sqlalchemy import SQLAlchemy
55
from sqlalchemy.orm import relationship
66
from flask_oauthlib.provider import OAuth2Provider
7-
from flask_oauthlib.contrib.bindings import (
8-
SQLAlchemyBinding,
9-
GrantCacheBinding
10-
)
7+
from flask_oauthlib.contrib.oauth2 import SQLAlchemyBinding
8+
from flask_oauthlib.contrib.oauth2 import grant_cache_binding
119

1210

1311
db = SQLAlchemy()
@@ -124,9 +122,8 @@ def cache_provider(app):
124122
SQLAlchemyBinding(oauth, db.session, user=User,
125123
token=Token, client=Client)
126124

127-
GrantCacheBinding(app, oauth, current_user,
128-
config={'OAUTH2_CACHE_TYPE': 'simple'})
129-
125+
app.config.update({'OAUTH2_CACHE_TYPE': 'simple'})
126+
grant_cache_binding(app, oauth, current_user)
130127
return oauth
131128

132129

0 commit comments

Comments
 (0)