diff --git a/addons/mail/tests/test_mail_access_rights.py b/addons/mail/tests/test_mail_access_rights.py index adc073d1791..e110afc6b09 100644 --- a/addons/mail/tests/test_mail_access_rights.py +++ b/addons/mail/tests/test_mail_access_rights.py @@ -221,13 +221,20 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups): # Test: raoul is follower of the group he created self.assertEqual(set(group_doc.message_follower_ids), set([partner_raoul]), 'Create failed, the creator must follow the document he created.') - # Test: raoul modify the group + # Test: raoul can modify the group self.mail_group.write(cr, user_raoul_id, [group_doc_id], {'name': name2}) self.assertEqual(group_doc.name, name2, 'Write failed, the followers can modify the group.') # Test: bert try to modify the group but must raise self.assertRaises(except_orm, - self.mail_message.write, + self.mail_group.write, cr, user_bert_id, [group_doc_id], {'name': name2}) - # todo test unlink \ No newline at end of file + # Test: bert try to unlink the group but must raise + self.assertRaises(except_orm, + self.mail_group.unlink, + cr, user_bert_id, [group_doc_id]) + + # Test: bert can unlink the group + self.mail_group.unlink(cr, user_raoul_id, [group_doc_id]) + self.assertFalse(self.mail_group.search(cr, user_raoul_id, [["id", "=", group_doc_id]]), 'Unlink failed, the followers can unlink the group.')