Commit c9c0da46 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Eteri

testSQLCatalog: Revert "Remove table name from selected column aliases."

This change is not the correct one, and not at the correct time. Will be
re-applied when select_dict later looses the ability to strip table in
favour of stricter argument schema.
parent 5d1b0ab7
......@@ -700,18 +700,18 @@ class TestSQLCatalog(ERP5TypeTestCase):
# "{column: None}" form, as otherwise it's the user explicitely asking for
# such alias (which is not strictly invalid).
sql_expression = self.asSQLExpression({'select_dict': {
'foo_default': None,
'foo_keyword': 'foo.keyword',
'foo.default': None,
'foo.keyword': 'foo.keyword',
}}, query_table='foo')
select_dict = sql_expression.getSelectDict()
self.assertTrue('default' in select_dict, select_dict)
self.assertFalse('foo_default' in select_dict, select_dict)
self.assertTrue('foo_keyword' in select_dict, select_dict)
self.assertFalse('foo.default' in select_dict, select_dict)
self.assertTrue('foo.keyword' in select_dict, select_dict)
# Variant: same operation, but this time stripping generates an ambiguity.
# That must be detected and cause a mapping exception.
self.assertRaises(ValueError, self.asSQLExpression, {'select_dict': {
'foo_ambiguous_mapping': None,
'bar_ambiguous_mapping': None,
'foo.ambiguous_mapping': None,
'bar.ambiguous_mapping': None,
}}, query_table='foo')
def test_hasColumn(self):
......
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