'test new-style Python constraints'

def test_15_constraint(self):

    discussion = self.env.ref('test_new_api.discussion_0')
    discussion.participants -= self.env.user
    with self.assertRaises(Exception):
        self.env['test_new_api.message'].create({'discussion': discussion.id, 'body': 'Whatever'})
    self.assertFalse(self.env.has_todo())
    discussion.participants += self.env.user
    self.env['test_new_api.message'].create({'discussion': discussion.id, 'body': 'Whatever'})
