Commit e804be5f authored by Vincent Pelletier's avatar Vincent Pelletier

Let's see test results if ignore_unknown_columns is set to False (except for...

Let's see test results if ignore_unknown_columns is set to False (except for listbox which propagates all parameters)
parent d8fac823
......@@ -52,11 +52,12 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
Lists each variation
"""
# Stock management
def _callSimulationTool(self, method_id, **kw):
def _callSimulationTool(self, method_id, ignore_unknown_columns=True, **kw):
return getattr(
self.getPortalObject().portal_simulation,
method_id,
)(
ignore_unknown_columns=ignore_unknown_columns,
node_uid=self.node_uid,
variation_text=self.variation_text,
resource_uid=self.resource_uid,
......
......@@ -73,7 +73,7 @@ node = context.Base_getAdvancedSearchSyntaxTreeNode(value, column=column)\n
if node is None:\n
return context.buildSingleQuery(column, value)\n
else:\n
return context.buildQueryFromAbstractSyntaxTreeNode(node, column)\n
return context.buildQueryFromAbstractSyntaxTreeNode(node, column, ignore_unknown_columns=True)\n
</string> </value>
</item>
<item>
......
......@@ -1693,10 +1693,6 @@ class TestMovementHistoryList(InventoryAPITestCase):
self.assertRaises(ValueError,
getMovementHistoryList,
section_category='group/notexists')
# (but other arguments are ignored)
self.assertEqual(len(getMovementHistoryList(
section_category='group/level1',
ignored='argument')), 1)
@expectedFailure
def testDoubleSectionCategory(self):
......
......@@ -210,6 +210,7 @@ class Selection(Acquisition.Implicit, Traversable, Persistent):
kw = self.params.copy()
else:
kw = params.copy()
kw.setdefault("ignore_unknown_columns", True)
# Always remove '-C'-named parameter.
kw.pop('-C', None)
if self.invert_mode is not 0:
......
......@@ -2178,7 +2178,7 @@ class Catalog(Folder,
result = None
return result
def buildQueryFromAbstractSyntaxTreeNode(self, node, key, wrap=lambda x: x, ignore_unknown_columns=True):
def buildQueryFromAbstractSyntaxTreeNode(self, node, key, wrap=lambda x: x, ignore_unknown_columns=False):
"""
Build a query from given Abstract Syntax Tree (AST) node by recursing in
its childs.
......@@ -2231,7 +2231,7 @@ class Catalog(Folder,
return self._parseSearchText(self.getSearchKey(
column, search_key=search_key), search_text, is_valid=is_valid)
def buildQuery(self, kw, ignore_empty_string=True, operator='and', ignore_unknown_columns=True):
def buildQuery(self, kw, ignore_empty_string=True, operator='and', ignore_unknown_columns=False):
query_list = []
append = query_list.append
# unknown_column_dict: contains all (key, value) pairs which could not be
......@@ -2368,7 +2368,7 @@ class Catalog(Folder,
return order_by_list
def buildEntireQuery(self, kw, query_table='catalog', ignore_empty_string=1,
limit=None, extra_column_list=(), ignore_unknown_columns=True):
limit=None, extra_column_list=(), ignore_unknown_columns=False):
group_by_list = kw.pop('group_by_list', kw.pop('group_by', kw.pop('group_by_expression', ())))
if isinstance(group_by_list, basestring):
group_by_list = [x.strip() for x in group_by_list.split(',')]
......@@ -2441,7 +2441,7 @@ class Catalog(Folder,
def buildSQLQuery(self, query_table='catalog', REQUEST=None,
ignore_empty_string=1, only_group_columns=False,
limit=None, extra_column_list=(),
ignore_unknown_columns=True, **kw):
ignore_unknown_columns=False, **kw):
return self.buildEntireQuery(
kw,
query_table=query_table,
......
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