This commit is contained in:
Chris Van 2011-06-17 15:13:21 -07:00
Родитель 5d139a242a
Коммит 37adbf3165
3 изменённых файлов: 18 добавлений и 1 удалений

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

@ -410,6 +410,15 @@ class ListTest(TestCase):
"""Tests the list view with various urls."""
fixtures = ['base/apps', 'base/addon_3615', 'base/featured']
def setUp(self):
# TODO(cvan): These tests will need to be rewritten for featured
# collections.
self._new_features = settings.NEW_FEATURES
settings.NEW_FEATURES = False
def tearDown(self):
settings.NEW_FEATURES = self._new_features
def test_defaults(self):
"""
This tests the default settings for /list.

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

@ -7,6 +7,7 @@ import json
import random
import urllib
from django.conf import settings
from django.http import HttpResponse, HttpResponsePermanentRedirect
from django.template.context import get_standard_processors
from django.utils import translation, encoding
@ -287,7 +288,10 @@ class ListView(APIView):
.order_by('-hotness'))[:limit + BUFFER]
shuffle = False
else:
ids = Addon.new_featured_random(APP, self.request.LANG)
if settings.NEW_FEATURES:
ids = Addon.new_featured_random(APP, self.request.LANG)
else:
ids = Addon.featured_random(APP, self.request.LANG)
addons = manual_order(qs, ids[:limit + BUFFER], 'addons.id')
shuffle = False

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

@ -931,6 +931,10 @@ VALIDATE_ADDONS = True
SEARCH_EXCLUDE_PERSONAS = True
UNLINK_SITE_STATS = True
# Use featured collections.
NEW_FEATURES = True
# Set to True if we're allowed to use X-SENDFILE.
XSENDFILE = True