bug 590587, don't index privates.
This commit is contained in:
Родитель
0b2be5a0c4
Коммит
3664d6185e
|
@ -10,6 +10,7 @@ from pyquery import PyQuery as pq
|
|||
|
||||
import amo
|
||||
from amo.urlresolvers import reverse
|
||||
from bandwagon.models import Collection
|
||||
from search.client import (extract_from_query, get_category_id,
|
||||
Client as SearchClient, CollectionsClient,
|
||||
PersonasClient, SearchError, )
|
||||
|
@ -85,6 +86,20 @@ class CollectionsSearchTest(SphinxTestCase):
|
|||
eq_(r, [])
|
||||
|
||||
|
||||
class CollectionsPrivateSearchTest(SphinxTestCase):
|
||||
fixtures = ('base/collection_57181', 'base/apps',)
|
||||
|
||||
def setUp(self):
|
||||
c = Collection.objects.get(pk=57181)
|
||||
c.listed = False
|
||||
c.save()
|
||||
super(CollectionsPrivateSearchTest, self).setUp()
|
||||
|
||||
def test_query(self):
|
||||
r = cquery("")
|
||||
eq_(r, [], "Collection shouldn't show up.")
|
||||
|
||||
|
||||
class SearchDownTest(test_utils.TestCase):
|
||||
|
||||
def test_search_down(self):
|
||||
|
|
|
@ -320,7 +320,8 @@ source collections
|
|||
OR description.locale IS NOT NULL \
|
||||
OR description.localized_string IS NOT NULL \
|
||||
) \
|
||||
AND c.uuid != ''
|
||||
AND c.uuid != '' \
|
||||
AND c.listed = 1
|
||||
sql_attr_uint = collection_id
|
||||
sql_attr_uint = locale_ord
|
||||
sql_attr_str2ordinal = locale
|
||||
|
|
Загрузка…
Ссылка в новой задаче