changeset 4007:bcb56b2011af

merged main
author Byeongweon [tasyblue@gmail.com]
date Mon, 11 Aug 2008 14:49:18 +0900
parents 751b42486f2a (current diff) 28442c70f757 (diff)
children 740e37c6ae92
files
diffstat 4 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_PageEditor.py	Mon Aug 11 14:12:09 2008 +0900
+++ b/MoinMoin/_tests/test_PageEditor.py	Mon Aug 11 14:49:18 2008 +0900
@@ -210,6 +210,7 @@
         """
         simple test if it is possible to delete a Dict page after creation
         """
+        become_trusted(self.request)
         pagename = u'SomeDict'
         page = PageEditor(self.request, pagename, do_editor_backup=0)
         body = u"This is an example text"
--- a/MoinMoin/_tests/test_packages.py	Mon Aug 11 14:12:09 2008 +0900
+++ b/MoinMoin/_tests/test_packages.py	Mon Aug 11 14:49:18 2008 +0900
@@ -86,7 +86,7 @@
 
     def testSearch(self):
         package = PackagePages(self.request.rootpage.page_name, self.request)
-        assert package.searchpackage(self.request, "Bad") == [u'BadContent']
+        assert package.searchpackage(self.request, "BadCon") == [u'BadContent']
 
     def testListCreate(self):
         package = PackagePages(self.request.rootpage.page_name, self.request)
--- a/MoinMoin/conftest.py	Mon Aug 11 14:12:09 2008 +0900
+++ b/MoinMoin/conftest.py	Mon Aug 11 14:49:18 2008 +0900
@@ -170,9 +170,9 @@
 
 class MoinTestFunction(py.test.collect.Function):
     def execute(self, target, *args):
-        request = self.parent.request
         co = target.func_code
         if 'request' in co.co_varnames[:co.co_argcount]:
+            request = init_test_request()
             target(request, *args)
         else:
             target(*args)
@@ -183,8 +183,9 @@
 
     def setup(self):
         cls = self.obj
-        cls.request = self.parent.request
-        cls.TestConfig = TestConfig(cls.request)
+        if not hasattr(cls, 'request'):
+            cls.request = init_test_request()
+            cls.TestConfig = TestConfig(cls.request)
         super(MoinClassCollector, self).setup()
 
 
@@ -192,10 +193,6 @@
     Class = MoinClassCollector
     Function = MoinTestFunction
 
-    def __init__(self, *args, **kwargs):
-        self.request = init_test_request()
-        super(Module, self).__init__(*args, **kwargs)
-
     def run(self, *args, **kwargs):
         if coverage is not None:
             coverage_modules.update(getattr(self.obj, 'coverage_modules', []))
--- a/MoinMoin/security/_tests/test_security.py	Mon Aug 11 14:12:09 2008 +0900
+++ b/MoinMoin/security/_tests/test_security.py	Mon Aug 11 14:49:18 2008 +0900
@@ -257,7 +257,7 @@
     subpage_name = u'AclTestMainPage/SubPage'
     pages = [
         # pagename, content
-        (mainpage_name, u"#acl JoeDoe: JaneDoe:read,write\nFoo!"),
+        (mainpage_name, u"#acl JoeDoe:\n#acl JaneDoe:read,write\nFoo!"),
         (subpage_name, u"FooFoo!"),
     ]