コード例 #1
0
ファイル: helpers.py プロジェクト: kewisch/addons-server
def sharing_box(context):
    request = context['request']

    services = sharing.get_services()

    c = dict(context.items())
    c.update({'request': request, 'user': request.user, 'services': services})
    return c
コード例 #2
0
ファイル: helpers.py プロジェクト: Mritrocker96/addons-server
def sharing_widget(context, obj, condensed=False):
    c = dict(context.items())
    services = sharing.get_services()

    c.update({
        'condensed': condensed,
        'services': services,
        'obj': obj,
    })
    return c
コード例 #3
0
ファイル: helpers.py プロジェクト: kewisch/addons-server
def sharing_widget(context, obj, condensed=False):
    c = dict(context.items())
    services = sharing.get_services()

    c.update({
        'condensed': condensed,
        'services': services,
        'obj': obj,
    })
    return c
コード例 #4
0
ファイル: helpers.py プロジェクト: Mritrocker96/addons-server
def sharing_box(context):
    request = context['request']

    services = sharing.get_services()

    c = dict(context.items())
    c.update({
        'request': request,
        'user': request.user,
        'services': services
    })
    return c
コード例 #5
0
ファイル: tests.py プロジェクト: gregglind/addons-server
def test_get_services_in_ja_locale():

    testo = sharing.LOCALSERVICE1
    testo.shortname = 'translated-localservice1'

    expected = [
        'facebook', 'twitter', 'gplus', 'Reddit', 'Tumblr',
        'translated-localservice1'
    ]

    with patch.object(sharing, 'LOCALSERVICE1', testo):
        old_locale = translation.get_language()
        try:
            activate('ja')
            assert expected == [s.shortname for s in sharing.get_services()]
        finally:
            activate(old_locale)
コード例 #6
0
ファイル: tests.py プロジェクト: aelawson/addons-server
def test_get_services_in_ja_locale():

    testo = sharing.LOCALSERVICE1
    testo.shortname = 'translated-localservice1'

    expected = [
        'facebook',
        'twitter',
        'gplus',
        'Reddit',
        'Tumblr',
        'translated-localservice1']

    with patch.object(sharing, 'LOCALSERVICE1', testo):
        old_locale = translation.get_language()
        try:
            activate('ja')
            assert expected == [s.shortname for s in sharing.get_services()]
        finally:
            activate(old_locale)
コード例 #7
0
ファイル: tests.py プロジェクト: aelawson/addons-server
def test_get_services_in_en_locale():
    # The order is the same as the order of sharing.SERVICES_LIST
    l = ['facebook', 'twitter', 'gplus', 'Reddit', 'Tumblr']
    assert l == [s.shortname for s in sharing.get_services()]
コード例 #8
0
ファイル: tests.py プロジェクト: gregglind/addons-server
def test_get_services_in_en_locale():
    # The order is the same as the order of sharing.SERVICES_LIST
    l = ['facebook', 'twitter', 'gplus', 'Reddit', 'Tumblr']
    assert l == [s.shortname for s in sharing.get_services()]