changeset 2880:6739287e65c9

test_wikidicts: copy Group page test added
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 26 Sep 2007 18:24:20 +0200
parents 07cd2b5f0fb9
children e4a320fe298a
files MoinMoin/_tests/test_wikidicts.py
diffstat 1 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikidicts.py	Wed Sep 26 18:23:19 2007 +0200
+++ b/MoinMoin/_tests/test_wikidicts.py	Wed Sep 26 18:24:20 2007 +0200
@@ -142,5 +142,38 @@
 
         assert u'ExampleUser' in members
 
+    def testCopyGroupPage(self):
+        """
+         tests if the dict cache for groups is refreshed after copying a Group page
+        """
+        gain_superuser_rights(self.request)
+        pagename = u'SomeGroup'
+        page = PageEditor(self.request, pagename, do_editor_backup=False)
+        body = " * ExampleUser"
+        page.saveText(body, 0)
+
+        page.copyPage(u'OtherGroup')
+
+        group = wikidicts.Group(self.request, '')
+        isgroup = self.request.cfg.cache.page_group_regex.search
+        grouppages = self.request.rootpage.getPageList(user='', filter=isgroup)
+
+        members, groups = self.request.dicts.expand_group(u'OtherGroup')
+        page = PageEditor(self.request, u'OtherGroup', do_editor_backup=0)
+
+        # real delete AnotherGroup page from filesystem
+        import shutil
+        page = PageEditor(self.request, u'OtherGroup', do_editor_backup=0)
+        fpath = page.getPagePath(check_create=0)
+        shutil.rmtree(fpath, True)
+
+        # real delete AnotherGroup page from filesystem
+        import shutil
+        page = PageEditor(self.request, u'SomeGroup', do_editor_backup=0)
+        fpath = page.getPagePath(check_create=0)
+        shutil.rmtree(fpath, True)
+
+        assert u'ExampleUser' in members
+
 coverage_modules = ['MoinMoin.wikidicts']