|
@ -44,27 +44,22 @@ class RefreshTestCase(common.TransactionCase): |
|
|
|
|
|
|
|
|
def test_refresh_rule(self): |
|
|
def test_refresh_rule(self): |
|
|
start = self.bus.search([], count=True) |
|
|
start = self.bus.search([], count=True) |
|
|
model = self.model.search([('model', '=', 'ir.logging')], limit=1) |
|
|
|
|
|
|
|
|
model = self.model.search([('model', '=', 'res.partner')], limit=1) |
|
|
self.rule.create({ |
|
|
self.rule.create({ |
|
|
'name': "TestRule", |
|
|
'name': "TestRule", |
|
|
'model': model.id, |
|
|
'model': model.id, |
|
|
'refresh_create': True, |
|
|
'refresh_create': True, |
|
|
'refresh_write': True, |
|
|
'refresh_write': True, |
|
|
'refresh_unlink': True}) |
|
|
'refresh_unlink': True}) |
|
|
log = model.create({ |
|
|
|
|
|
|
|
|
partner = model.create({ |
|
|
'name': "Test", |
|
|
'name': "Test", |
|
|
'type': "server", |
|
|
|
|
|
'message': "Test", |
|
|
|
|
|
'path': "/", |
|
|
|
|
|
'func': "Test", |
|
|
|
|
|
'line': "1", |
|
|
|
|
|
}) |
|
|
}) |
|
|
create = self.bus.search([], count=True) |
|
|
create = self.bus.search([], count=True) |
|
|
self.assertTrue(start < create) |
|
|
self.assertTrue(start < create) |
|
|
log.write({'name': "Rename"}) |
|
|
|
|
|
|
|
|
partner.write({'name': "Rename"}) |
|
|
write = self.bus.search([], count=True) |
|
|
write = self.bus.search([], count=True) |
|
|
self.assertTrue(write > create) |
|
|
self.assertTrue(write > create) |
|
|
log.unlink() |
|
|
|
|
|
|
|
|
partner.unlink() |
|
|
delete = self.bus.search([], count=True) |
|
|
delete = self.bus.search([], count=True) |
|
|
self.assertTrue(write < delete) |
|
|
self.assertTrue(write < delete) |
|
|
|
|
|
|
|
|