[FIX] fixes the read_group by dates tests (makes them use the field:interval syntax instead of using the context (test_orm.py)
bzr revid: ged@openerp.com-20140123105638-l4ej76ynf4avcjma
This commit is contained in:
@@ -131,18 +131,7 @@ class TestORM(common.TransactionCase):
|
||||
else:
|
||||
domain = main_domain
|
||||
|
||||
display_format, groupby_format = {
|
||||
'year': ('YYYY', 'yyyy'),
|
||||
'month': ('YYYY-MM', 'yyyy-mm'),
|
||||
'day': ('yyyy-MM-dd', 'yyyy-mm-dd'),
|
||||
}[interval]
|
||||
|
||||
datetime_format = {
|
||||
'date': dict(interval=interval, display_format=display_format, groupby_format=groupby_format)
|
||||
}
|
||||
context = dict(datetime_format=datetime_format)
|
||||
|
||||
rg = self.partner.read_group(self.cr, self.uid, domain, ['date'], 'date', context=context)
|
||||
rg = self.partner.read_group(self.cr, self.uid, domain, ['date'], 'date' + ':' + interval)
|
||||
result = {}
|
||||
for r in rg:
|
||||
result[r['date']] = set(self.partner.search(self.cr, self.uid, r['__domain']))
|
||||
|
||||
Reference in New Issue
Block a user