changeset 4953:ca4d2f593508

fix GetVal test (strangely, the failure only surfaced with py.test 1.0.1, not with 0.9.0)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 20 Aug 2009 14:42:36 +0200
parents 2117e64aea4e
children 043baa5879b3 3b35ab786859
files MoinMoin/macro/_tests/test_GetVal.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/_tests/test_GetVal.py	Sun Aug 09 01:30:45 2009 +0200
+++ b/MoinMoin/macro/_tests/test_GetVal.py	Thu Aug 20 14:42:36 2009 +0200
@@ -23,14 +23,14 @@
     def teardown_class(self):
         nuke_page(self.request, self.pagename)
 
-    def _test_macro(self, name, args):
-        m = make_macro(self.request, self.page)
+    def _test_macro(self, name, args, page):
+        m = make_macro(self.request, page)
         return m.execute(name, args)
 
     def testGetValNoACLs(self):
         """ macro GetVal test: 'reads VAR' """
-        self.page = create_page(self.request, self.pagename, u' VAR:: This is an example')
-        result = self._test_macro(u'GetVal', "%s,%s" % (self.pagename, u'VAR'))
+        page = create_page(self.request, self.pagename, u' VAR:: This is an example')
+        result = self._test_macro(u'GetVal', "%s,%s" % (self.pagename, u'VAR'), page)
         assert result == "This is an example"
 
     def testGetValAfterADictPageIsDeleted(self):
@@ -39,16 +39,16 @@
         page = create_page(request, u'SomeDict', u" EXAMPLE:: This is an example text")
         page.deletePage()
         page = create_page(request, self.pagename, u' VAR:: This is a brand new example')
-        result = self._test_macro(u'GetVal', "%s,%s" % (self.pagename, u'VAR'))
+        result = self._test_macro(u'GetVal', "%s,%s" % (self.pagename, u'VAR'), page)
         nuke_page(request, u'SomeDict')
         assert result == "This is a brand new example"
 
     def testGetValACLs(self):
         """ macro GetVal test: 'cant read VAR on an ACL protected page' """
         py.test.skip("user has no rights to create acl pages")
-        self.page = create_page(self.request, self.pagename,
-                                '#acl SomeUser:read,write All:delete\n VAR:: This is an example')
-        result = self._test_macro(u'GetVal', "%s,%s" % (self.pagename, u'VAR'))
+        page = create_page(self.request, self.pagename,
+                           '#acl SomeUser:read,write All:delete\n VAR:: This is an example')
+        result = self._test_macro(u'GetVal', "%s,%s" % (self.pagename, u'VAR'), page)
         assert result == "&lt;&lt;GetVal: You don't have enough rights on this page&gt;&gt;"
 
 coverage_modules = ['MoinMoin.macro.GetVal']