source: products/qPloneComments/tags/2.3/tests/testQPloneCommentsPermission.py @ 1591

Last change on this file since 1591 was 1, checked in by myroslav, 18 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1#
2# Test 'Moderate Discussion' permission
3#
4
5import os, sys, string
6if __name__ == '__main__':
7    execfile(os.path.join(sys.path[0], 'framework.py'))
8
9from Products.PloneTestCase import PloneTestCase
10from Products.CMFCore.utils import getToolByName
11from AccessControl import getSecurityManager
12
13PRODUCT = 'qPloneComments'
14PERM_NAME = 'Moderate Discussion'
15PloneTestCase.installProduct(PRODUCT)
16PloneTestCase.setupPloneSite()
17
18from Products.CMFDefault.DiscussionItem import DiscussionItemContainer
19
20class TestPermission(PloneTestCase.PloneTestCase):
21
22    def afterSetUp(self):
23        self.loginAsPortalOwner()
24        self.portal.portal_quickinstaller.installProduct(PRODUCT)
25       
26    def test_install_moderate_discussion_permission(self):
27        roles = [item['name'] for item in self.portal.rolesOfPermission(PERM_NAME) if item['selected'] == 'SELECTED']
28        self.assert_( roles != [], '%s not installed'%PERM_NAME)
29
30    def test_deleteReply_permission(self):
31        #dic = DiscussionItemContainer()
32        #dic.createReply('Title', 'Text')
33        pass
34
35    def test_manager_moderation(self):
36        pass
37
38
39def test_suite():
40    from unittest import TestSuite, makeSuite
41    suite = TestSuite()
42    suite.addTest(makeSuite(TestPermission))
43    return suite
44
45if __name__ == '__main__':
46    framework()
47
Note: See TracBrowser for help on using the repository browser.