Skip to content

Commit

Permalink
Test cases for access token generator. #42
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Sep 15, 2013
1 parent 14cd2bf commit 521c13b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/oauth2/test_oauth2.py
Expand Up @@ -270,3 +270,19 @@ class TestCredentialAuthSQLAlchemy(TestCredentialAuth):

def create_oauth_provider(self, app):
return sqlalchemy_provider(app)


class TestTokenGenerator(OAuthSuite):

def create_oauth_provider(self, app):

def generator(request, refresh_token=False):
return 'foobar'

app.config['OAUTH2_PROVIDER_TOKEN_GENERATOR'] = generator
return default_provider(app)

def test_get_access_token(self):
rv = self.client.post(authorize_url, data={'confirm': 'yes'})
rv = self.client.get(clean_url(rv.location))
assert 'foobar' in u(rv.data)

0 comments on commit 521c13b

Please sign in to comment.