Show More
@@ -78,16 +78,18 b' class TestAdminUsersGroupsController(Tes' | |||||
78 | response.follow() |
|
78 | response.follow() | |
79 | ug = UserGroup.get_by_group_name(users_group_name) |
|
79 | ug = UserGroup.get_by_group_name(users_group_name) | |
80 | p = Permission.get_by_key('hg.create.repository') |
|
80 | p = Permission.get_by_key('hg.create.repository') | |
81 |
p2 = Permission.get_by_key('hg. |
|
81 | p2 = Permission.get_by_key('hg.usergroup.create.false') | |
|
82 | p3 = Permission.get_by_key('hg.fork.none') | |||
82 | # check if user has this perms, they should be here since |
|
83 | # check if user has this perms, they should be here since | |
83 | # defaults are on |
|
84 | # defaults are on | |
84 | perms = UserGroupToPerm.query()\ |
|
85 | perms = UserGroupToPerm.query()\ | |
85 | .filter(UserGroupToPerm.users_group == ug).all() |
|
86 | .filter(UserGroupToPerm.users_group == ug).all() | |
86 |
|
87 | |||
87 | self.assertEqual( |
|
88 | self.assertEqual( | |
88 | [[x.users_group_id, x.permission_id, ] for x in perms], |
|
89 | sorted([[x.users_group_id, x.permission_id, ] for x in perms]), | |
89 | [[ug.users_group_id, p.permission_id], |
|
90 | sorted([[ug.users_group_id, p.permission_id], | |
90 |
[ug.users_group_id, p2.permission_id] |
|
91 | [ug.users_group_id, p2.permission_id], | |
|
92 | [ug.users_group_id, p3.permission_id]]) | |||
91 | ) |
|
93 | ) | |
92 |
|
94 | |||
93 | ## DISABLE REPO CREATE ON A GROUP |
|
95 | ## DISABLE REPO CREATE ON A GROUP | |
@@ -97,7 +99,9 b' class TestAdminUsersGroupsController(Tes' | |||||
97 | response.follow() |
|
99 | response.follow() | |
98 | ug = UserGroup.get_by_group_name(users_group_name) |
|
100 | ug = UserGroup.get_by_group_name(users_group_name) | |
99 | p = Permission.get_by_key('hg.create.none') |
|
101 | p = Permission.get_by_key('hg.create.none') | |
100 |
p2 = Permission.get_by_key('hg. |
|
102 | p2 = Permission.get_by_key('hg.usergroup.create.false') | |
|
103 | p3 = Permission.get_by_key('hg.fork.none') | |||
|
104 | ||||
101 | # check if user has this perms, they should be here since |
|
105 | # check if user has this perms, they should be here since | |
102 | # defaults are on |
|
106 | # defaults are on | |
103 | perms = UserGroupToPerm.query()\ |
|
107 | perms = UserGroupToPerm.query()\ | |
@@ -106,7 +110,8 b' class TestAdminUsersGroupsController(Tes' | |||||
106 | self.assertEqual( |
|
110 | self.assertEqual( | |
107 | sorted([[x.users_group_id, x.permission_id, ] for x in perms]), |
|
111 | sorted([[x.users_group_id, x.permission_id, ] for x in perms]), | |
108 | sorted([[ug.users_group_id, p.permission_id], |
|
112 | sorted([[ug.users_group_id, p.permission_id], | |
109 |
[ug.users_group_id, p2.permission_id] |
|
113 | [ug.users_group_id, p2.permission_id], | |
|
114 | [ug.users_group_id, p3.permission_id]]) | |||
110 | ) |
|
115 | ) | |
111 |
|
116 | |||
112 | # DELETE ! |
|
117 | # DELETE ! | |
@@ -147,16 +152,18 b' class TestAdminUsersGroupsController(Tes' | |||||
147 | response.follow() |
|
152 | response.follow() | |
148 | ug = UserGroup.get_by_group_name(users_group_name) |
|
153 | ug = UserGroup.get_by_group_name(users_group_name) | |
149 | p = Permission.get_by_key('hg.create.none') |
|
154 | p = Permission.get_by_key('hg.create.none') | |
150 |
p2 = Permission.get_by_key('hg. |
|
155 | p2 = Permission.get_by_key('hg.usergroup.create.false') | |
|
156 | p3 = Permission.get_by_key('hg.fork.repository') | |||
151 | # check if user has this perms, they should be here since |
|
157 | # check if user has this perms, they should be here since | |
152 | # defaults are on |
|
158 | # defaults are on | |
153 | perms = UserGroupToPerm.query()\ |
|
159 | perms = UserGroupToPerm.query()\ | |
154 | .filter(UserGroupToPerm.users_group == ug).all() |
|
160 | .filter(UserGroupToPerm.users_group == ug).all() | |
155 |
|
161 | |||
156 | self.assertEqual( |
|
162 | self.assertEqual( | |
157 | [[x.users_group_id, x.permission_id, ] for x in perms], |
|
163 | sorted([[x.users_group_id, x.permission_id, ] for x in perms]), | |
158 | [[ug.users_group_id, p.permission_id], |
|
164 | sorted([[ug.users_group_id, p.permission_id], | |
159 |
[ug.users_group_id, p2.permission_id] |
|
165 | [ug.users_group_id, p2.permission_id], | |
|
166 | [ug.users_group_id, p3.permission_id]]) | |||
160 | ) |
|
167 | ) | |
161 |
|
168 | |||
162 | ## DISABLE REPO CREATE ON A GROUP |
|
169 | ## DISABLE REPO CREATE ON A GROUP | |
@@ -166,16 +173,18 b' class TestAdminUsersGroupsController(Tes' | |||||
166 | response.follow() |
|
173 | response.follow() | |
167 | ug = UserGroup.get_by_group_name(users_group_name) |
|
174 | ug = UserGroup.get_by_group_name(users_group_name) | |
168 | p = Permission.get_by_key('hg.create.none') |
|
175 | p = Permission.get_by_key('hg.create.none') | |
169 |
p2 = Permission.get_by_key('hg. |
|
176 | p2 = Permission.get_by_key('hg.usergroup.create.false') | |
|
177 | p3 = Permission.get_by_key('hg.fork.none') | |||
170 | # check if user has this perms, they should be here since |
|
178 | # check if user has this perms, they should be here since | |
171 | # defaults are on |
|
179 | # defaults are on | |
172 | perms = UserGroupToPerm.query()\ |
|
180 | perms = UserGroupToPerm.query()\ | |
173 | .filter(UserGroupToPerm.users_group == ug).all() |
|
181 | .filter(UserGroupToPerm.users_group == ug).all() | |
174 |
|
182 | |||
175 | self.assertEqual( |
|
183 | self.assertEqual( | |
176 | [[x.users_group_id, x.permission_id, ] for x in perms], |
|
184 | sorted([[x.users_group_id, x.permission_id, ] for x in perms]), | |
177 | [[ug.users_group_id, p.permission_id], |
|
185 | sorted([[ug.users_group_id, p.permission_id], | |
178 |
[ug.users_group_id, p2.permission_id] |
|
186 | [ug.users_group_id, p2.permission_id], | |
|
187 | [ug.users_group_id, p3.permission_id]]) | |||
179 | ) |
|
188 | ) | |
180 |
|
189 | |||
181 | # DELETE ! |
|
190 | # DELETE ! |
General Comments 0
You need to be logged in to leave comments.
Login now