gcb_web_auth/tests_utils.py
def make_oauth_service(cls=MagicMock, save=False):
    """
    Helper method that can make a mock service with the parameters
    or a full database-backed object if the OAuthService class is passed
    :param cls: Class to instantiate
    :param save: If true, call save() on the service afer creating
    :return: a mocked object or database backed (ready for save())
    """
    service = cls(client_id='id123',
                  client_secret='secret456',
                  redirect_uri='redirect',
                  scope='scope1',
                  authorization_uri='authorize',
                  token_uri='token')
    if save: service.save()
    return service

    Helper method that can make a mock service with the parameters
    or a full database-backed object if the OAuthService class is passed
    :param cls: Class to instantiate
    :param save: If true, call save() on the service afer creating
    :return: a mocked object or database backed (ready for save())
    
Helper method that can make a mock service with the parameters
or a full database-backed object if the OAuthService class is passed
Helper method that can make a mock service with the parameters or a full database - backed object if the OAuthService class is passed
def make_oauth_service(cls=MagicMock, save=False):
    service = cls(client_id='id123',
                  client_secret='secret456',
                  redirect_uri='redirect',
                  scope='scope1',
                  authorization_uri='authorize',
                  token_uri='token')
    if save: service.save()
    return service
def make_oauth_service ( cls = MagicMock , save = False ) : service = cls ( client_id = 'id123' , client_secret = 'secret456' , redirect_uri = 'redirect' , scope = 'scope1' , authorization_uri = 'authorize' , token_uri = 'token' ) if save : service . save ( ) return service
Helper method that can make a mock service with the parameters
or a full database-backed object if the OAuthService class is passed
Helper method that can make a mock service with the parameters or a full database - backed object if the OAuthService class is passed
"""
    Helper method that can make a mock service with the parameters
    or a full database-backed object if the OAuthService class is passed
    :param cls: Class to instantiate
    :param save: If true, call save() on the service afer creating
    :return: a mocked object or database backed (ready for save())
    """
a mocked object or database backed (ready for save())
a mocked object or database backed ( ready for save () )
cls
Class to instantiate
Class to instantiate
save
If true, call save() on the service afer creating
If true call save () on the service afer creating