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'
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'
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')
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)