comparison MoinMoin/datastruct/backends/_tests/test_wiki_groups.py @ 5787:00704da830ea

Fixed bug in groups formatter which caused the last list item to be not in the group. Removed some tests that didn't make sense for me, added some new to detect this bug.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 02 Aug 2011 23:52:32 +0200
parents c299e8ece712
children
comparison
equal deleted inserted replaced
5786:8cb5ab136b87 5787:00704da830ea
179 nuke_page(request, u'NewGroup') 179 nuke_page(request, u'NewGroup')
180 180
181 assert not has_rights_before, 'AnotherUser has no read rights because in the beginning he is not a member of a group page NewGroup' 181 assert not has_rights_before, 'AnotherUser has no read rights because in the beginning he is not a member of a group page NewGroup'
182 assert has_rights_after, 'AnotherUser must have read rights because after appendage he is member of NewGroup' 182 assert has_rights_after, 'AnotherUser must have read rights because after appendage he is member of NewGroup'
183 183
184 def test_simple_group_page(self):
185 """
186 Tests if a simple group page is evaluated correctly.
187 """
188 request = self.request
189 become_trusted(request)
190 group_name = u'SimpleGroup'
191 page_text = u"""\
192 * FirstUser
193 * SecondUser
194 * LastUser"""
195 page = create_page(request, group_name, page_text)
196 group_members = set(request.groups[group_name])
197 assert group_members == set([u'FirstUser', u'SecondUser', u'LastUser'])
198 nuke_page(request, group_name)
199
200 def test_complex_group_page(self):
201 """
202 Tests if a complex group page is evaluated correctly.
203 """
204 request = self.request
205 become_trusted(request)
206 group_name = u'ComplexGroup'
207 page_text = u"""\
208 * FirstUser
209 * any text
210 * SecondUser
211 * LastUser
212 * any text"""
213 page = create_page(request, group_name, page_text)
214 group_members = set(request.groups[group_name])
215 assert group_members == set([u'FirstUser', u'SecondUser', u'LastUser'])
216 nuke_page(request, group_name)
217
184 coverage_modules = ['MoinMoin.datastruct.backends.wiki_groups'] 218 coverage_modules = ['MoinMoin.datastruct.backends.wiki_groups']
185 219