[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:
Gery Debongnie
2014-01-23 11:56:38 +01:00
parent 74386a5bb9
commit 74fd48e608
+1 -12
View File
@@ -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']))