[FIX] base: test_search, invalid use of search criterion 'active in (True, False)' replaced by 'active is True OR active is False'
bzr revid: qdp-launchpad@openerp.com-20121121125347-hsihsibwz0igp03r
This commit is contained in:
parent
d0b4d040e1
commit
b4742249b4
|
@ -35,21 +35,21 @@ class test_expression(common.TransactionCase):
|
|||
# The inactive records shouldn't be ecxluded as soon as a condition on this field is present in the domain
|
||||
# criteria. The 'order' parameter of search() should support any valable coma-separated value
|
||||
|
||||
active_asc_id_asc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), ('active', 'in', (True, False))], order="active asc, id asc")
|
||||
active_asc_id_asc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), '|', ('active', '=', True), ('active', '=', False)], order="active asc, id asc")
|
||||
self.assertEqual([d, e, c, a, b, ab], active_asc_id_asc, "Search with 'ACTIVE ASC, ID ASC' order failed.")
|
||||
active_desc_id_asc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), ('active', 'in', (True, False))], order="active desc, id asc")
|
||||
active_desc_id_asc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), '|', ('active', '=', True), ('active', '=', False)], order="active desc, id asc")
|
||||
self.assertEqual([c, a, b, ab, d, e], active_desc_id_asc, "Search with 'ACTIVE DESC, ID ASC' order failed.")
|
||||
active_asc_id_desc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), ('active', 'in', (True, False))], order="active asc, id desc")
|
||||
active_asc_id_desc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), '|', ('active', '=', True), ('active', '=', False)], order="active asc, id desc")
|
||||
self.assertEqual([e, d, ab, b, a, c], active_asc_id_desc, "Search with 'ACTIVE ASC, ID DESC' order failed.")
|
||||
active_desc_id_desc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), ('active', 'in', (True, False))], order="active desc, id desc")
|
||||
active_desc_id_desc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), '|', ('active', '=', True), ('active', '=', False)], order="active desc, id desc")
|
||||
self.assertEqual([ab, b, a, c, e, d], active_desc_id_desc, "Search with 'ACTIVE DESC, ID DESC' order failed.")
|
||||
id_asc_active_asc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), ('active', 'in', (True, False))], order="id asc, active asc")
|
||||
self.assertEqual(id_asc, id_asc_active_asc, "Search with 'ID ASC, ACTIVE ASC' order failed.")
|
||||
id_asc_active_desc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), ('active', 'in', (True, False))], order="id asc, active desc")
|
||||
self.assertEqual(id_asc, id_asc_active_desc, "Search with 'ID ASC, ACTIVE DESC' order failed.")
|
||||
id_desc_active_asc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), ('active', 'in', (True, False))], order="id desc, active asc")
|
||||
self.assertEqual(id_desc, id_desc_active_asc, "Search with 'ID DESC, ACTIVE ASC' order failed.")
|
||||
id_desc_active_desc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), ('active', 'in', (True, False))], order="id desc, active desc")
|
||||
self.assertEqual(id_desc, id_desc_active_desc, "Search with 'ID DESC, ACTIVE DESC' order failed.")
|
||||
id_asc_active_asc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), '|', ('active', '=', True), ('active', '=', False)], order="id asc, active asc")
|
||||
self.assertEqual([c, d, a, b, ab, e], id_asc_active_asc, "Search with 'ID ASC, ACTIVE ASC' order failed.")
|
||||
id_asc_active_desc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), '|', ('active', '=', True), ('active', '=', False)], order="id asc, active desc")
|
||||
self.assertEqual([c, d, a, b, ab, e], id_asc_active_desc, "Search with 'ID ASC, ACTIVE DESC' order failed.")
|
||||
id_desc_active_asc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), '|', ('active', '=', True), ('active', '=', False)], order="id desc, active asc")
|
||||
self.assertEqual([e, ab, b, a, d, c], id_desc_active_asc, "Search with 'ID DESC, ACTIVE ASC' order failed.")
|
||||
id_desc_active_desc = partners.search(cr, uid, [('name', 'like', 'test_search_order%'), '|', ('active', '=', True), ('active', '=', False)], order="id desc, active desc")
|
||||
self.assertEqual([e, ab, b, a, d, c], id_desc_active_desc, "Search with 'ID DESC, ACTIVE DESC' order failed.")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue