def prepare_data(self, token_endpoint_auth_method='none'):
    server = create_authorization_server(self.app)
    server.register_grant(AuthorizationCodeGrant, [CodeChallenge(required=True)])
    user = User(username='foo')
    db.session.add(user)
    db.session.commit()
    client_secret = ''
    if (token_endpoint_auth_method != 'none'):
        client_secret = 'code-secret'
    client = Client(user_id=user.id, client_id='code-client', client_secret=client_secret, redirect_uri='https://a.b', scope='profile address', token_endpoint_auth_method=token_endpoint_auth_method, response_type='code', grant_type='authorization_code')
    self.authorize_url = '/oauth/authorize?response_type=code&client_id=code-client'
    db.session.add(client)
    db.session.commit()
def prepare_data(self, token_endpoint_auth_method='none'):
    server = create_authorization_server(self.app)
    server.register_grant(AuthorizationCodeGrant, [CodeChallenge(required=True)])
    user = User(username='foo')
    db.session.add(user)
    db.session.commit()
    client_secret = 
    if (token_endpoint_auth_method != 'none'):
        client_secret = 'code-secret'
    client = Client(user_id=user.id, client_id='code-client', client_secret=client_secret, redirect_uri='https://a.b', scope='profile address', token_endpoint_auth_method=token_endpoint_auth_method, response_type='code', grant_type='authorization_code')
    self.authorize_url = '/oauth/authorize?response_type=code&client_id=code-client'
    db.session.add(client)
    db.session.commit()