Merge branch 'tree-tab-567611'

This commit is contained in:
Dave Dash 2010-05-28 15:00:04 -07:00
Родитель 6b8798e785 3482d92f42
Коммит f8c44862b7
2 изменённых файлов: 24 добавлений и 2 удалений

Просмотреть файл

@ -189,6 +189,28 @@ class TestCategoryPages(test_utils.TestCase):
creatured = response.context['filter'].all()['featured']
eq_(len(creatured), 0)
def test_creatured_only_public(self):
"""Make sure the creatured add-ons are all public."""
url = reverse('browse.creatured', args=['bookmarks'])
r = self.client.get(url, follow=True)
addons = r.context['addons']
for a in addons:
assert a.status == amo.STATUS_PUBLIC, "%s is not public" % a.name
old_count = len(addons)
addons[0].status = amo.STATUS_UNREVIEWED
addons[0].save()
r = self.client.get(url, follow=True)
addons = r.context['addons']
for a in addons:
assert a.status == amo.STATUS_PUBLIC, ("Altered %s is featured"
% a.name)
eq_(len(addons), old_count - 1, "The number of addons is the same.")
def test_added_date(self):
url = reverse('browse.extensions') + '?sort=created'
doc = pq(self.client.get(url).content)

Просмотреть файл

@ -239,8 +239,8 @@ def creatured(request, category):
TYPE = amo.ADDON_EXTENSION
q = Category.objects.filter(application=request.APP.id, type=TYPE)
category = get_object_or_404(q, slug=category)
addons = Addon.objects.filter(addoncategory__feature=True,
addoncategory__category=category)
addons = Addon.objects.public().filter(addoncategory__feature=True,
addoncategory__category=category)
return jingo.render(request, 'browse/creatured.html',
{'addons': addons, 'category': category})