diff options
| author | Foram Katharotiya (OpenERP) <fka@tinyerp.com> | 2012-06-15 17:09:10 +0530 |
|---|---|---|
| committer | Foram Katharotiya (OpenERP) <fka@tinyerp.com> | 2012-06-15 17:09:10 +0530 |
| commit | ff354166b4eab15e0b3fe2e1f9f6d619dcd476d5 (patch) | |
| tree | dba2adc361db0f21eee97974eef8884ad81525d0 | |
| parent | 5eacdd5bd048c6a59f0c3c6f49f75d19e64a2163 (diff) | |
[IMP] improve in server side
bzr revid: fka@tinyerp.com-20120615113910-qd6xmaistkrioc0y
| -rw-r--r-- | openerp/addons/base/test/test_osv_expression.yml | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/openerp/addons/base/test/test_osv_expression.yml b/openerp/addons/base/test/test_osv_expression.yml index fa7a69b74e9..0165b61b275 100644 --- a/openerp/addons/base/test/test_osv_expression.yml +++ b/openerp/addons/base/test/test_osv_expression.yml @@ -75,7 +75,7 @@ Trying the "in" operator, for scalar value - !python {model: res.partner }: | - ids = self.search(cr, uid, [('parent_id','in','Agrolait')]) + ids = self.search(cr, uid, [('parent_id','=','Agrolait')]) assert len(ids) >= 1, ids - Trying the "in" operator for list value @@ -229,7 +229,7 @@ res_0.sort() res_1 = self.search(cr, uid, [('parent_id', 'not in', [max_partner_id + 1])]) # get all rows, included null parent_id res_1.sort() - res_2 = self.search(cr, uid, [('parent_id', 'not in', False)]) # get rows with not null parent_id, deprecated syntax + res_2 = self.search(cr, uid, [('parent_id', '!=', False)]) # get rows with not null parent_id, deprecated syntax res_2.sort() res_3 = self.search(cr, uid, [('parent_id', 'not in', [])]) # get all rows, included null parent_id res_3.sort() @@ -249,7 +249,7 @@ res_5.sort() res_6 = self.search(cr, uid, [('parent_id', 'in', [max_partner_id + 1])]) res_6.sort() - res_7 = self.search(cr, uid, [('parent_id', 'in', False)]) + res_7 = self.search(cr, uid, [('parent_id', '=', False)]) res_7.sort() res_8 = self.search(cr, uid, [('parent_id', 'in', [])]) res_8.sort() @@ -270,7 +270,7 @@ res_10.sort() res_11 = self.search(cr, uid, ['!', ('parent_id', 'in', [max_partner_id + 1])]) res_11.sort() - res_12 = self.search(cr, uid, ['!', ('parent_id', 'in', False)]) + res_12 = self.search(cr, uid, ['!', ('parent_id', '=', False)]) res_12.sort() res_13 = self.search(cr, uid, ['!', ('parent_id', 'in', [])]) res_13.sort() @@ -291,7 +291,7 @@ res_16.sort() assert res_16 == partner_ids - res_17 = self.search(cr, uid, [('website', 'not in', False)]) + res_17 = self.search(cr, uid, [('website', '!=', False)]) res_17.sort() assert res_17 == with_website @@ -306,21 +306,21 @@ assert res_101 == [], 'res_101: expected %r, got %r' % ([], res_101) assert res_102 == company_ids, 'res_102: expected %r, got %r' % (company_ids, res_102) - - Property of the query (one2many not in False). + Property of the query (one2many != 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)])) + companies = set(self.pool.get('res.company').search(cr, uid, [('currency_ids', '!=', False)])) assert referenced_companies == companies - - Property of the query (one2many in False). + Property of the query (one2many = 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)])) + companies = set(self.pool.get('res.company').search(cr, uid, [('currency_ids', '=', False)])) assert unreferenced_companies == companies - Equivalent queries. @@ -331,7 +331,7 @@ res_1 = self.search(cr, uid, [('name', 'not like', 'probably_unexisting_name')]) res_2 = self.search(cr, uid, [('id', 'not in', [max_currency_id + 1003])]) res_3 = self.search(cr, uid, [('id', 'not in', [])]) - res_4 = self.search(cr, uid, [('id', 'not in', False)]) + res_4 = self.search(cr, uid, [('id', '!=', False)]) res_0.sort() res_1.sort() res_2.sort() @@ -414,7 +414,7 @@ # get the companies referenced by some currency (this is normally the main company) res_10 = self.search(cr, uid, [('currency_ids', 'not like', 'probably_unexisting_name')]) res_11 = self.search(cr, uid, [('currency_ids', 'not in', [max_currency_id + 1])]) - res_12 = self.search(cr, uid, [('currency_ids', 'not in', False)]) + res_12 = self.search(cr, uid, [('currency_ids', '!=', False)]) res_13 = self.search(cr, uid, [('currency_ids', 'not in', [])]) res_10.sort() res_11.sort() @@ -527,3 +527,4 @@ res_ids = self.search(cr, uid, [('child_ids.country_id','=','Belgium'),('active','=',False)]) assert len(res_ids) != 0, "Record not Found with country Belgium and active False." + |
