[IMP] mail: unlink test access rights

bzr revid: chm@openerp.com-20121206125615-sdswn1fphlt4yarm
This commit is contained in:
Christophe Matthieu
2012-12-06 13:56:15 +01:00
parent 671a1d72f1
commit 217d83f710
+10 -3
View File
@@ -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
# 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.')