コード例 #1
0
    def test_statusflags(self):
        ctx = {'APP': amo.FIREFOX, 'LANG': 'en-US'}

        # unreviewed
        a = Addon(status=amo.STATUS_UNREVIEWED)
        assert statusflags(ctx, a) == 'unreviewed'

        # featured
        featured = Addon.objects.get(pk=1003)
        assert statusflags(ctx, featured) == 'featuredaddon'

        # category featured
        featured = Addon.objects.get(pk=1001)
        assert statusflags(ctx, featured) == 'featuredaddon'
コード例 #2
0
    def test_statusflags(self):
        ctx = {'APP': amo.FIREFOX, 'LANG': 'en-US'}

        # unreviewed
        a = Addon(status=amo.STATUS_NOMINATED)
        assert statusflags(ctx, a) == 'unreviewed'

        # featured
        featured = Addon.objects.get(pk=1003)
        assert statusflags(ctx, featured) == 'featuredaddon'

        # category featured
        featured = Addon.objects.get(pk=1001)
        assert statusflags(ctx, featured) == 'featuredaddon'
コード例 #3
0
ファイル: test_helpers.py プロジェクト: kewisch/addons-server
    def test_statusflags(self):
        ctx = {'APP': amo.FIREFOX, 'LANG': 'en-US'}

        # unreviewed
        a = Addon(status=amo.STATUS_UNREVIEWED)
        eq_(statusflags(ctx, a), 'unreviewed')

        # featured
        featured = Addon.objects.get(pk=1003)
        eq_(statusflags(ctx, featured), 'featuredaddon')

        # category featured
        featured = Addon.objects.get(pk=1001)
        eq_(statusflags(ctx, featured), 'featuredaddon')
コード例 #4
0
ファイル: buttons.py プロジェクト: bychek-ru/addons-server
def mobile_install_button(context, addon, **kwargs):
    from olympia.addons.helpers import statusflags
    button = install_button(context, addon, detailed=True, size='prominent',
                            mobile=True, show_contrib=False, **kwargs)
    flags = jinja2.escape(statusflags(context, addon))
    markup = u'<div class="install-wrapper %s">%s</div>' % (flags, button)
    return jinja2.Markup(markup)
コード例 #5
0
def mobile_install_button(context, addon, **kwargs):
    from olympia.addons.helpers import statusflags
    button = install_button(context, addon, detailed=True, size='prominent',
                            mobile=True, show_contrib=False, **kwargs)
    flags = jinja2.escape(statusflags(context, addon))
    markup = u'<div class="install-wrapper %s">%s</div>' % (flags, button)
    return jinja2.Markup(markup)