Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/browse/templates/browse/impala/category_landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1>{{ title }}</h1>
{% set link = request.get_full_path()|urlparams(sort=key) %}
{% set hc_src = 'cb-hc-' + src_dict[key] %}
{% set dl_src = 'cb-dl-' + src_dict[key] %}
{% set vital = ('adu', 'rating') if key == popular else ('rating', 'adu') %}
{% set vital = ('adu', 'rating') if key == 'popular' else ('rating', 'adu') %}
<div class="island c">
<h2>
{{ filter.opts_dict[key] }}
Expand All @@ -39,7 +39,7 @@ <h2>
vital_summary=vital[0], vital_more=vital[1]) }}
</div>
{% endfor %}
<h2 class="seeall"><a href="{{ request.get_full_path()|urlparams(sort=popular) }}">
<h2 class="seeall"><a href="{{ request.get_full_path()|urlparams(sort='popular') }}">
{% if section == 'extensions' %}
{% trans cnt = category.count, name = category.name %}
See the {{ cnt }} extension in {{ name }} &raquo;
Expand Down
8 changes: 8 additions & 0 deletions apps/browse/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ def test_popular_adu_unit(self):
'%s weekly download%s' % (numberfmt(adu),
's' if adu != 1 else ''))

def test_seeall_link_should_have_a_sort(self):
category = Category.objects.get(pk=1)
url = reverse('browse.extensions', kwargs={'category': category.slug})
response = self.client.get(url)
self.assertTemplateUsed(response, "browse/impala/category_landing.html")
doc = pq(response.content)
assert "sort=popular" in doc('.seeall a').attr('href')


class TestLanguageTools(amo.tests.TestCase):
fixtures = ['browse/test_views']
Expand Down