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