Ejemplo n.º 1
0
def test_fxa_config():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    assert helpers.fxa_config(context) == {
        'clientId': 'foo',
        'something': 'hello, world!',
        'state': 'thestate!',
        'aDifferentThing': 'howdy, world!',
    }
Ejemplo n.º 2
0
def test_fxa_config():
    context = mock.MagicMock()
    context['request'].session = {'fxa_state': 'thestate!'}
    assert helpers.fxa_config(context) == {
        'clientId': 'foo',
        'something': 'hello, world!',
        'state': 'thestate!',
        'aDifferentThing': 'howdy, world!',
    }
Ejemplo n.º 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',
        'something': 'hello, world!',
        'state': 'thestate!',
        'aDifferentThing': 'howdy, world!',
    }
Ejemplo n.º 4
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': '*****@*****.**',
    }
Ejemplo n.º 5
0
def test_fxa_config():
    assert helpers.fxa_config() == {
        'clientId': 'foo',
        'something': 'hello, world!',
        'aDifferentThing': 'howdy, world!',
    }