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