コード例 #1
0
ファイル: test_helpers.py プロジェクト: peterkinalex/olympia
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!',
    }
コード例 #2
0
ファイル: test_helpers.py プロジェクト: peterkinalex/olympia
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!',
    }
コード例 #3
0
ファイル: test_helpers.py プロジェクト: aniketkudale/olympia
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!',
    }
コード例 #4
0
ファイル: test_helpers.py プロジェクト: aniketkudale/olympia
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': '*****@*****.**',
    }
コード例 #5
0
ファイル: test_helpers.py プロジェクト: ki1023lou21/olympia
def test_fxa_config():
    assert helpers.fxa_config() == {
        'clientId': 'foo',
        'something': 'hello, world!',
        'aDifferentThing': 'howdy, world!',
    }