def test_blueprint_factory_default(): salesforce_bp = make_salesforce_blueprint( client_id="foo", client_secret="bar", scope="api", redirect_to="index", ) assert isinstance(salesforce_bp, OAuth2ConsumerBlueprint) assert salesforce_bp.session.scope == "api" assert salesforce_bp.session.base_url == "https://login.salesforce.com/" assert salesforce_bp.session.client_id == "foo" assert salesforce_bp.client_secret == "bar" assert (salesforce_bp.authorization_url == "https://login.salesforce.com/services/oauth2/authorize") assert (salesforce_bp.token_url == "https://login.salesforce.com/services/oauth2/token")
def test_blueprint_factory_scope(): salesforce_bp = make_salesforce_blueprint(client_id="foo", client_secret="bar", scope="customscope") assert salesforce_bp.session.scope == "customscope"
def _make_app(*args, **kwargs): app = Flask(__name__) app.secret_key = "whatever" blueprint = make_salesforce_blueprint(*args, **kwargs) app.register_blueprint(blueprint) return app