Skip to content

Commit

Permalink
tests for performance_note (bug 620093)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed Dec 27, 2010
1 parent e82acff commit eea48c8
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion apps/addons/tests/test_helpers.py
Expand Up @@ -4,7 +4,8 @@
from pyquery import PyQuery

import amo
from addons.helpers import statusflags, flag, support_addon, contribution
from addons.helpers import (statusflags, flag, support_addon, contribution,
performance_note)
from addons.models import Addon


Expand Down Expand Up @@ -69,3 +70,26 @@ def test_contribution_box(self):
# 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


class TestPerformanceNote(test_utils.TestCase):
listing = '<div class="performance-note">'
not_listing = '<div class="notification performance-note">'

def setUp(self):
request_mock = Mock()
request_mock.APP = amo.FIREFOX
self.ctx = {'request': request_mock, 'amo': amo}

def test_show_listing(self):
r = performance_note(self.ctx, 30, listing=True)
assert self.listing in r, r

def test_show_not_listing(self):
r = performance_note(self.ctx, 30)
assert self.not_listing in r, r

def test_only_fx(self):
self.ctx['request'].APP = amo.THUNDERBIRD
r = performance_note(self.ctx, 30)
eq_(r.strip(), '')

0 comments on commit eea48c8

Please sign in to comment.