diff --git a/mkt/lookup/templates/lookup/app_summary.html b/mkt/lookup/templates/lookup/app_summary.html index 793c00841f..ef62cf96a9 100644 --- a/mkt/lookup/templates/lookup/app_summary.html +++ b/mkt/lookup/templates/lookup/app_summary.html @@ -35,7 +35,7 @@ {{ amo.ADDON_TYPE[app.type] }}; {{ amo.ADDON_PREMIUM_TYPES[app.premium_type] }} {% if price %} - ({{ price.get_tier_name() }}) + ({{ price.tier_locale() }}) {% endif %}
{{ _('Submitted') }}
diff --git a/mkt/site/helpers.py b/mkt/site/helpers.py index 8f9515a67a..450dc60655 100644 --- a/mkt/site/helpers.py +++ b/mkt/site/helpers.py @@ -152,13 +152,9 @@ def product_as_dict(request, product, purchased=None, receipt_type=None, ret.update({'previews': previews}) if product.has_price(): - # Note: These should really not be doing this, if get_price - # or get_price_locale is empty it means there is no price for this - # region. ret.update({ - 'price': product.get_price(region=request.REGION.id) or '0', - 'priceLocale': (product.get_price_locale(region=request.REGION.id) - or _('Free')), + 'price': product.get_price(region=request.REGION.id), + 'priceLocale': product.get_price_locale(region=request.REGION.id), }) if request.amo_user: diff --git a/mkt/site/templates/site/tiles/app.html b/mkt/site/templates/site/tiles/app.html index ffd60fef66..c2e71926e1 100644 --- a/mkt/site/templates/site/tiles/app.html +++ b/mkt/site/templates/site/tiles/app.html @@ -25,7 +25,7 @@ {{ market_button(product, classes=classes) }}
{{ product.current_version.developer_name }}
{%- endif %} -
{{ product.get_price_locale(region=request.REGION.id) or _('Free') }}
+
{% if product.is_premium() %}{{ product.get_price_locale(region=request.REGION.id) }}{% else %}Free{% endif %}
{%- if tag != "a" -%} diff --git a/mkt/site/tests/test_helpers.py b/mkt/site/tests/test_helpers.py index c55d746bfa..e0f848193e 100644 --- a/mkt/site/tests/test_helpers.py +++ b/mkt/site/tests/test_helpers.py @@ -99,9 +99,8 @@ class TestMarketButton(amo.tests.TestCase): # The region is set to Spain, so the currency is set EUR # and the display is set to French. with self.activate('fr'): - # TODO bug: 878215, find what the answer here is. - with self.assertRaises(KeyError): - market_tile(self.context, self.webapp) + doc = pq(market_tile(self.context, self.webapp)) + eq_(doc('.price').text(), '') def test_is_premium_purchased(self): AddonPurchase.objects.create(user=self.user, addon=self.webapp)