From a6b1964813fba671df730d08fc9ef7a9748f5e9f Mon Sep 17 00:00:00 2001 From: "Naresh (OpenERP)" Date: Fri, 27 May 2011 11:17:51 +0530 Subject: [PATCH] [IMP]:added .yml test cases for hierarchical search bzr revid: nch@tinyerp.com-20110527054751-pcvlts8vu17doyv9 --- .../addons/base/test/test_osv_expression.yml | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/test/test_osv_expression.yml b/openerp/addons/base/test/test_osv_expression.yml index 4916fe06203..6ee5d06e2fd 100644 --- a/openerp/addons/base/test/test_osv_expression.yml +++ b/openerp/addons/base/test/test_osv_expression.yml @@ -1,3 +1,23 @@ +- + Testing for hierarchical search in M2M +- + !python {model: res.partner }: | + ids = self.search(cr, uid, [('category_id', 'child_of','supplier')]) + assert len(ids) >= 1, ids + +- + Test hierarchical search in M2M with child ID1 +- + !python {model: res.partner }: | + ids = self.search(cr, uid, [('category_id', 'child_of','Components Supplier')]) + assert len(ids) >= 1, ids +- + Test hierarchical search in M2M with child ID2 +- + !python {model: res.partner }: | + ids = self.search(cr, uid, [('category_id', 'child_of','Miscellaneous Suppliers')]) + assert len(ids) >= 1, ids + - Testing that some domain expressions work - @@ -40,7 +60,7 @@ - !assert {model: res.partner, search: "[('category_id', '=', False)]"}: - category_id in (False, None, []) -- +- Filtering on invalid value across x2many relationship should return an empty set - !assert {model: res.partner, search: "[('address.city','=','foo')]", count: 0, string: "Searching for address.city = foo should give empty results"}