[IMP]mail: suppress compare value for testing of access rights
bzr revid: chm@openerp.com-20121207094356-d34o92weyivzfpde
This commit is contained in:
@@ -211,30 +211,19 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups):
|
||||
user_raoul_id, user_raoul, partner_raoul = self.user_raoul_id, self.user_raoul, self.user_raoul.partner_id
|
||||
user_bert_id, user_bert, partner_bert = self.user_bert_id, self.user_bert, self.user_bert.partner_id
|
||||
|
||||
name = 'Doc group'
|
||||
name2 = 'Doc group 2'
|
||||
|
||||
# Raoul create a document mail_group
|
||||
group_doc_id = self.mail_group.create(cr, user_raoul_id, {'name': name})
|
||||
group_doc_id = self.mail_group.create(cr, user_raoul_id, {'name': 'Doc group'})
|
||||
group_doc = self.mail_group.browse(cr, user_raoul_id, group_doc_id)
|
||||
|
||||
# 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 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.')
|
||||
|
||||
self.mail_group.write(cr, user_raoul_id, [group_doc_id], {'name': 'Doc group 2'})
|
||||
# Test: bert try to modify the group but must raise
|
||||
self.assertRaises(except_orm,
|
||||
self.mail_group.write,
|
||||
cr, user_bert_id, [group_doc_id], {'name': name2})
|
||||
|
||||
cr, user_bert_id, [group_doc_id], {'name': 'Doc group 3'})
|
||||
# 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.')
|
||||
|
||||
Reference in New Issue
Block a user