bug 596771, allow '_' in guids for search
This commit is contained in:
Родитель
97ad1d934e
Коммит
6362bfed2e
|
@ -468,6 +468,11 @@ class SearchTest(SphinxTestCase):
|
|||
'2587%25E5%25A0%2582/all/10/WINNT/3.6', version=1.2)
|
||||
self.assertContains(resp, '<addon id="6113">')
|
||||
|
||||
def test_guid_query(self):
|
||||
r = make_call('search/guid:{22870005-adef-4c9d-ae36-d0e1f2f27e5a},'
|
||||
'{2fa4ed95-0317-4c6a-a74c-5f3e3912c1f9}')
|
||||
eq_(['3615', '6113'], [a.attrib['id'] for a in pq(r.content)('addon')])
|
||||
|
||||
def test_zero_results(self):
|
||||
"""
|
||||
Tests that the search API correctly gives us zero results found.
|
||||
|
|
|
@ -107,7 +107,7 @@ def extract_filters(term, kwargs):
|
|||
metas['type'] = addon_type
|
||||
|
||||
# Guid filtering..
|
||||
(term, guids) = extract_from_query(term, 'guid', '[{}@\.,\-0-9a-zA-Z]+',
|
||||
(term, guids) = extract_from_query(term, 'guid', '[{}@_\.,\-0-9a-zA-Z]+',
|
||||
end_of_word_boundary=False)
|
||||
|
||||
if guids:
|
||||
|
|
|
@ -7,7 +7,7 @@ SETTINGS_DIR = os.path.realpath(
|
|||
sys.path.append(SETTINGS_DIR)
|
||||
sys.path.append(os.path.join(SETTINGS_DIR, 'lib'))
|
||||
|
||||
import settings_local as settings
|
||||
from manage import settings
|
||||
|
||||
s = settings.DATABASES['default']
|
||||
MYSQL_PASS = s['PASSWORD']
|
||||
|
|
Загрузка…
Ссылка в новой задаче