Commit bec0e1cb authored by Vincent Pelletier's avatar Vincent Pelletier

Add a test for query generation from a syntax tree containing a "not" operator.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26141 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cc54b8ed
......@@ -352,6 +352,12 @@ class TestSQLCatalog(unittest.TestCase):
{'keyword': '<"=a OR =b"'})
self.catalog(ReferenceQuery(ReferenceQuery(operator='like', keyword='%"a" OR "b"%'), operator='and'),
{'keyword': '"\\"a\\" OR \\"b\\""'})
self.catalog(ReferenceQuery(ReferenceQuery(ReferenceQuery(operator='match', fulltext='a'),
ReferenceQuery(ReferenceQuery(operator='match', fulltext='b'), operator='not'), operator='or'), operator='and'),
{'fulltext': 'a NOT b'})
self.catalog(ReferenceQuery(ReferenceQuery(ReferenceQuery(operator='match', fulltext='a'),
ReferenceQuery(ReferenceQuery(operator='match', fulltext='b'), operator='not'), operator='and'), operator='and'),
{'fulltext': 'a AND NOT b'})
def test_006_testRelatedKey_with_multiple_join(self):
# The name of catalog parameter does not matter at all
......
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