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!', }
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!', }
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': '*****@*****.**', }
def test_fxa_config(): assert helpers.fxa_config() == { 'clientId': 'foo', 'something': 'hello, world!', 'aDifferentThing': 'howdy, world!', }