From e7b726639ee02943c13eea302d450affe48f9374 Mon Sep 17 00:00:00 2001 From: Fred Wenzel Date: Tue, 30 Mar 2010 09:39:02 +0200 Subject: [PATCH] fixed Bug 555867 - Raw code is output in Contributions pop-up dialog --- apps/addons/templates/addons/contribution.html | 4 ++-- apps/addons/tests/test_helpers.py | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/addons/templates/addons/contribution.html b/apps/addons/templates/addons/contribution.html index 710e8e396b6..ad9cd347102 100644 --- a/apps/addons/templates/addons/contribution.html +++ b/apps/addons/templates/addons/contribution.html @@ -103,7 +103,7 @@

{{ _('How much would you like to contribute?') }}

{# L10n: {0} is a currency symbol (e.g., $), {1} is an amount input field #} {{ _('A one-time contribution of {0} {1}')|f( - '$', '') }} + '$', '')|safe }}
  • @@ -113,7 +113,7 @@

    {{ _('How much would you like to contribute?') }}

    {# L10n: {0} is a currency symbol (e.g., $), {1} is an amount input field #} {{ _('A regular monthly contribution of {0} {1}')|f( - '$', '') }} + '$', '')|safe }}
  • diff --git a/apps/addons/tests/test_helpers.py b/apps/addons/tests/test_helpers.py index 8aa94f2b599..2d53c86806b 100644 --- a/apps/addons/tests/test_helpers.py +++ b/apps/addons/tests/test_helpers.py @@ -5,7 +5,7 @@ from pyquery import PyQuery import amo -from addons.helpers import statusflags, flag, support_addon +from addons.helpers import statusflags, flag, support_addon, contribution from addons.models import Addon @@ -57,3 +57,11 @@ def test_support_addon(self): doc = PyQuery(support_addon(a)) eq_(doc('.support-this-addon').text(), 'Support this add-on: Contribute $12.00') + + def test_contribution_box(self): + a = Addon.objects.get(pk=1003) + a.suggested_amount = '12' + doc = PyQuery(contribution(a)) + # make sure input boxes are rendered correctly (bug 555867) + assert doc('input[name=onetime-amount]').length == 1 + assert doc('input[name=monthly-amount]').length == 1