Commit cb533cf3 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[test rql completion] dont limit number of completion, else we've impredicable...

[test rql completion] dont limit number of completion, else we've impredicable results. Also should tell rql.parse to not print error on stdout

This repairs test introduced by dcd9bc1d1bca which closes #2439846
parent e83b4a64ba29
......@@ -235,7 +235,6 @@ class RQLSuggestionsBuilderTC(CubicWebTC):
def suggestions(self, rql):
req = self.request()
rbs = self.vreg['components'].select('rql.suggestions', req)
rbs.attr_value_limit = 10 # limit to 10 to ease vocabulry tests
return rbs.build_suggestions(rql)
def test_no_restrictions_rql(self):
......@@ -319,6 +318,11 @@ class RQLSuggestionsBuilderTC(CubicWebTC):
req.create_entity('Personne', nom=u'n%s' % i, prenom=u'p%s' % i)
self.assertListEqual(['Any X WHERE X is Personne, X nom "n0"',
'Any X WHERE X is Personne, X nom "n1"',
'Any X WHERE X is Personne, X nom "n10"',
'Any X WHERE X is Personne, X nom "n11"',
'Any X WHERE X is Personne, X nom "n12"',
'Any X WHERE X is Personne, X nom "n13"',
'Any X WHERE X is Personne, X nom "n14"',
'Any X WHERE X is Personne, X nom "n2"',
'Any X WHERE X is Personne, X nom "n3"',
'Any X WHERE X is Personne, X nom "n4"',
......
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
......@@ -452,7 +452,7 @@ class RQLSuggestionsBuilder(Component):
else:
restrictions, incomplete_part = '', restrictions
user_rql = variables
select = parse(user_rql).children[0]
select = parse(user_rql, print_errors=False).children[0]
req.vreg.rqlhelper.annotate(select)
req.vreg.solutions(req, select, {})
if restrictions:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment