'test the cache consistency of a x2many field with a domain'

def test_60_x2many_domain(self):

    discussion = self.env.ref('test_new_api.discussion_0')
    message = discussion.messages[0]
    self.assertNotIn(message, discussion.important_messages)
    message.important = True
    self.assertIn(message, discussion.important_messages)
    self.assertIn(message, discussion.very_important_messages)
    discussion.write({'very_important_messages': [(5,)]})
    self.assertFalse(discussion.very_important_messages)
    self.assertFalse(message.exists())
