Mathias Markl 7 years ago
parent
commit
cb25b15d5e
  1. 15
      muk_web_client_refresh/tests/test_refresh.py

15
muk_web_client_refresh/tests/test_refresh.py

@ -46,7 +46,7 @@ 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', '=', 'res.partner')], limit=1) model = self.model.search([('model', '=', 'res.partner')], limit=1)
self.rule.create({
rule = self.rule.create({
'name': "TestRule", 'name': "TestRule",
'model': model.id, 'model': model.id,
'refresh_create': True, 'refresh_create': True,
@ -63,6 +63,19 @@ class RefreshTestCase(common.TransactionCase):
partner.unlink() partner.unlink()
delete = self.bus.search([], count=True) delete = self.bus.search([], count=True)
self.assertTrue(write < delete) self.assertTrue(write < delete)
rule.write({'refresh_create': False})
start = self.bus.search([], count=True)
partner = self.partner.create({
'name': "Test",
})
create = self.bus.search([], count=True)
self.assertTrue(start == create)
rule.unlink()
partner.unlink()
delete = self.bus.search([], count=True)
self.assertTrue(start == delete)
rule.unlink()
Loading…
Cancel
Save