Child: [795bba] (diff)

Download this file

test_wiki_roles.py    25 lines (20 with data), 985 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pylons import c, g
from pyforge.tests import helpers
from pyforge import model as M
def setUp():
helpers.setup_basic_test()
helpers.setup_global_objects()
g.set_app('wiki')
def test_role_assignments():
role_developer = M.ProjectRole.query.get(name='Developer')._id
role_auth = M.ProjectRole.query.get(name='*authenticated')._id
assert c.app.config.acl['configure'] == c.project.acl['plugin']
assert c.app.config.acl['read'] == c.project.acl['read']
assert c.app.config.acl['create'] == [role_developer]
assert c.app.config.acl['edit'] == [role_developer]
assert c.app.config.acl['delete'] == [role_developer]
assert c.app.config.acl['edit_page_permissions'] == c.project.acl['plugin']
assert c.app.config.acl['unmoderated_post'] == [role_developer]
assert c.app.config.acl['post'] == [role_auth]
assert c.app.config.acl['moderate'] == [role_developer]
assert c.app.config.acl['admin'] == c.project.acl['plugin']