예제 #1
0
def test_fxa_config_anonymous():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    context['request'].user.is_authenticated.return_value = False
    assert helpers.fxa_config(context) == {
        'clientId': 'foo',
        'something': 'hello, world!',
        'state': 'thestate!',
        'aDifferentThing': 'howdy, world!',
    }
예제 #2
0
def test_fxa_config_anonymous():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    context['request'].user.is_authenticated.return_value = False
    assert helpers.fxa_config(context) == {
        'clientId': 'foo',
        'something': 'hello, world!',
        'state': 'thestate!',
        'aDifferentThing': 'howdy, world!',
    }
예제 #3
0
def test_fxa_config_anonymous():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    context['request'].user.is_authenticated.return_value = False
    assert helpers.fxa_config(context) == {
        'clientId': 'foo',
        'state': 'thestate!',
        'oauthHost': 'https://accounts.firefox.com/oauth',
        'redirectUrl': 'https://testserver/fxa',
        'scope': 'profile',
    }
예제 #4
0
def test_fxa_config_anonymous():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    context['request'].user.is_authenticated.return_value = False
    assert helpers.fxa_config(context) == {
        'clientId': 'foo',
        'state': 'thestate!',
        'oauthHost': 'https://accounts.firefox.com/oauth',
        'redirectUrl': 'https://testserver/fxa',
        'scope': 'profile',
    }
예제 #5
0
def test_fxa_config_logged_in():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    context['request'].user.is_authenticated.return_value = True
    context['request'].user.email = '*****@*****.**'
    assert helpers.fxa_config(context) == {
        'clientId': 'foo',
        'something': 'hello, world!',
        'state': 'thestate!',
        'aDifferentThing': 'howdy, world!',
        'email': '*****@*****.**',
    }
예제 #6
0
def test_fxa_config_logged_in():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    context['request'].user.is_authenticated.return_value = True
    context['request'].user.email = '*****@*****.**'
    assert helpers.fxa_config(context) == {
        'clientId': 'foo',
        'something': 'hello, world!',
        'state': 'thestate!',
        'aDifferentThing': 'howdy, world!',
        'email': '*****@*****.**',
    }
예제 #7
0
def test_fxa_config_logged_in():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    context['request'].user.is_authenticated.return_value = True
    context['request'].user.email = '*****@*****.**'
    assert helpers.fxa_config(context) == {
        '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():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    context['request'].user.is_authenticated.return_value = True
    context['request'].user.email = '*****@*****.**'
    assert helpers.fxa_config(context) == {
        'clientId': 'foo',
        'state': 'thestate!',
        'email': '*****@*****.**',
        'oauthHost': 'https://accounts.firefox.com/oauth',
        'redirectUrl': 'https://testserver/fxa',
        'scope': 'profile',
    }