[IMP] expression: make one more assert pass in expression.py tests.

bzr revid: vmt@openerp.com-20110726152435-41jv1oryjkmiiy07
This commit is contained in:
Vo Minh Thu 2011-07-26 17:24:35 +02:00
parent 8522366247
commit 705cbcf213
2 changed files with 19 additions and 6 deletions

View File

@ -177,6 +177,23 @@
res_ids = self.search(cr, uid, [('company_id.partner_id', 'not in', [])])
res_ids.sort()
assert res_ids == all_ids, "Searching against empty set failed, returns %r" % res_ids
-
Property of the query (one2many not in False).
-
!python {model: res.currency }: |
ids = self.search(cr, uid, [])
referenced_companies = set([x.company_id.id for x in self.browse(cr, uid, ids)])
companies = set(self.pool.get('res.company').search(cr, uid, [('currency_ids', 'not in', False)]))
assert referenced_companies == companies
-
Property of the query (one2many in False).
-
!python {model: res.currency }: |
ids = self.search(cr, uid, [])
referenced_companies = set([x.company_id.id for x in self.browse(cr, uid, ids)])
unreferenced_companies = set(self.pool.get('res.company').search(cr, uid, [])).difference(referenced_companies)
companies = set(self.pool.get('res.company').search(cr, uid, [('currency_ids', 'in', False)]))
assert unreferenced_companies == companies
-
Equivalent queries.
-
@ -274,11 +291,9 @@
assert res_9 == []
print ">>> 10:", res_10
print ">>> 11:", res_11
print ">>> 12:", res_12
print ">>> 13:", res_13
#assert res_10 == res_11
#assert res_10 == res_12
#assert res_10 == res_13
assert res_10 == res_12
assert res_10 == res_13
# child_of x returns x and its children (direct or not).
company = self.browse(cr, uid, ref('ymltest_company3'))

View File

@ -293,8 +293,6 @@ class expression(object):
#no result found with given search criteria
call_null = False
self.__exp[i] = FALSE_LEAF
else:
operator = 'in' # operator changed because ids are directly related to main object
else:
call_null = False
o2m_op = 'in'