コード例 #1
0
def test_fxa_config_anonymous():
    request = RequestFactory().get('/en-US/firefox/addons')
    request.session = {'fxa_state': 'thestate!'}
    request.user = AnonymousUser()
    assert utils.fxa_config(request) == {
        'clientId': 'foo',
        'state': 'thestate!',
        'oauthHost': 'https://accounts.firefox.com/oauth',
        'redirectUrl': 'https://testserver/fxa',
        'scope': 'profile',
    }
コード例 #2
0
def test_fxa_config_anonymous():
    request = RequestFactory().get('/en-US/firefox/addons')
    request.session = {'fxa_state': 'thestate!'}
    request.user = AnonymousUser()
    assert utils.fxa_config(request) == {
        'clientId': 'foo',
        'state': 'thestate!',
        'oauthHost': 'https://accounts.firefox.com/oauth',
        'redirectUrl': 'https://testserver/fxa',
        'scope': 'profile',
    }
コード例 #3
0
ファイル: test_utils.py プロジェクト: Osmose/olympia
def test_fxa_config_anonymous():
    request = RequestFactory().get("/en-US/firefox/addons")
    request.session = {"fxa_state": "thestate!"}
    request.user = AnonymousUser()
    assert utils.fxa_config(request) == {
        "clientId": "foo",
        "state": "thestate!",
        "oauthHost": "https://accounts.firefox.com/oauth",
        "redirectUrl": "https://testserver/fxa",
        "scope": "profile",
    }
コード例 #4
0
def test_fxa_config_logged_in():
    request = RequestFactory().get('/en-US/firefox/addons')
    request.session = {'fxa_state': 'thestate!'}
    request.user = UserProfile(email='*****@*****.**')
    assert utils.fxa_config(request) == {
        'clientId': 'foo',
        'state': 'thestate!',
        'email': '*****@*****.**',
        'oauthHost': 'https://accounts.firefox.com/oauth',
        'redirectUrl': 'https://testserver/fxa',
        'scope': 'profile',
    }
コード例 #5
0
def test_fxa_config_anonymous():
    request = RequestFactory().get('/en-US/firefox/addons')
    request.session = {'fxa_state': 'thestate!'}
    request.user = AnonymousUser()
    assert utils.fxa_config(request) == {
        'clientId': 'foo',
        'state': 'thestate!',
        'oauthHost': 'https://oauth-stable.dev.lcip.org/v1',
        'contentHost': 'https://stable.dev.lcip.org',
        'profileHost': 'https://stable.dev.lcip.org/profile/v1',
        'scope': 'profile openid',
    }
コード例 #6
0
def test_fxa_config_logged_in():
    request = RequestFactory().get('/en-US/firefox/addons')
    request.session = {'fxa_state': 'thestate!'}
    request.user = UserProfile(email='*****@*****.**')
    assert utils.fxa_config(request) == {
        'clientId': 'foo',
        'state': 'thestate!',
        'email': '*****@*****.**',
        'oauthHost': 'https://accounts.firefox.com/oauth',
        'redirectUrl': 'https://testserver/fxa',
        'scope': 'profile',
    }
コード例 #7
0
ファイル: test_utils.py プロジェクト: Osmose/olympia
def test_fxa_config_logged_in():
    request = RequestFactory().get("/en-US/firefox/addons")
    request.session = {"fxa_state": "thestate!"}
    request.user = UserProfile(email="*****@*****.**")
    assert utils.fxa_config(request) == {
        "clientId": "foo",
        "state": "thestate!",
        "email": "*****@*****.**",
        "oauthHost": "https://accounts.firefox.com/oauth",
        "redirectUrl": "https://testserver/fxa",
        "scope": "profile",
    }
コード例 #8
0
def test_fxa_config_logged_in():
    request = RequestFactory().get('/en-US/firefox/addons')
    request.session = {'fxa_state': 'thestate!'}
    request.user = UserProfile(email='*****@*****.**')
    assert utils.fxa_config(request) == {
        'clientId': 'foo',
        'state': 'thestate!',
        'email': '*****@*****.**',
        'oauthHost': 'https://oauth-stable.dev.lcip.org/v1',
        'contentHost': 'https://stable.dev.lcip.org',
        'profileHost': 'https://stable.dev.lcip.org/profile/v1',
        'scope': 'profile openid',
    }
コード例 #9
0
def fxa_config(context):
    return utils.fxa_config(context['request'])