Skip to content

Commit

Permalink
fixed Bug 555867 - Raw code is output in Contributions pop-up dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Wenzel committed Mar 30, 2010
1 parent e66beb2 commit e7b7266
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/addons/templates/addons/contribution.html
Expand Up @@ -103,7 +103,7 @@ <h4>{{ _('How much would you like to contribute?') }}</h4>
{# L10n: {0} is a currency symbol (e.g., $),
{1} is an amount input field #}
{{ _('A one-time contribution of {0} {1}')|f(
'$', '<input type="text" name="onetime-amount" value=""/>') }}
'$', '<input type="text" name="onetime-amount" value=""/>')|safe }}
</label>
</li>
<li>
Expand All @@ -113,7 +113,7 @@ <h4>{{ _('How much would you like to contribute?') }}</h4>
{# L10n: {0} is a currency symbol (e.g., $),
{1} is an amount input field #}
{{ _('A regular monthly contribution of {0} {1}')|f(
'$', '<input type="text" name="monthly-amount" value=""/>') }}
'$', '<input type="text" name="monthly-amount" value=""/>')|safe }}
</label>
</li>
</ul>
Expand Down
10 changes: 9 additions & 1 deletion apps/addons/tests/test_helpers.py
Expand Up @@ -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


Expand Down Expand Up @@ -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

0 comments on commit e7b7266

Please sign in to comment.