* Update Webapp.featured to return a set of Webapp instances, rather than a
  QuerySet of their FeaturedApp instances.
* Fix incorrect use of the eq_ shortcut in
  TestFeaturedAppQueryset.test_queryset_featured
This commit is contained in:
Chuck Harmston 2013-02-15 09:12:10 -06:00
Родитель c030931537
Коммит db9a573198
2 изменённых файлов: 3 добавлений и 2 удалений

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

@ -525,7 +525,8 @@ class Webapp(Addon):
@classmethod
def featured(cls, cat=None, region=None, limit=6, mobile=False,
gaia=False):
return FeaturedApp.objects.featured(cat, region, limit, mobile, gaia)
qs = FeaturedApp.objects.featured(cat, region, limit, mobile, gaia)
return [w.app for w in qs]
@classmethod
def get_excluded_in(cls, region):

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

@ -444,7 +444,7 @@ class TestFeaturedAppQueryset(amo.tests.TestCase):
FeaturedApp.objects.featured()
), 'Inactive items in featured queryset'
limited = FeaturedApp.objects.featured(limit=1).count()
assert eq_(limited, 1), '%s items returned, only 1 expected' % limited
eq_(limited, 1, '%s items returned, only 1 expected' % limited)
class TestAddonSearch(amo.tests.ESTestCase):