def index():

    from oauth.storage import web2pyStorage as storage  # change to MongoStorage if you aren't using DAL
    storage = storage()
    storage.connect()
    oauth = OAuth2(storage)

    response.headers['Content-Type'] = json_headers()
    response.view = json_service()

    token, refresh, expires = oauth.grant_access_token(request.get_vars)
    return meta_data(CODES['ok'],
                     MESSAGES['ok'],
                     dict(access_token=token, token_type='Bearer',
                          expires_in=expires, refresh_token=refresh))
Ensure that ``assert_*`` methods from ``mock`` library is used correctly
dataset/ETHPy150Open joaoqalves/web2py-oauth2/controllers/token.py/index--crossover with--dataset/ETHPy150Open openstack/rally/tests/hacking/checks.py/check_assert_methods_from_mock