[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser/tests - testBrowserRequest.py:1.1.4.2
Jim Fulton
jim@zope.com
Tue, 26 Mar 2002 17:56:36 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv984/lib/python/Zope/Publisher/Browser/tests
Modified Files:
Tag: Zope-3x-branch
testBrowserRequest.py
Log Message:
Fixed :method handling broken in the publihser refactoring and added a test.
=== Zope3/lib/python/Zope/Publisher/Browser/tests/testBrowserRequest.py 1.1.4.1 => 1.1.4.2 ===
class Publication(DefaultPublication):
+ require_docstrings = 0
+
def getDefaultTraversal(self, request, ob):
if hasattr(ob, 'browserDefault'):
return ob.browserDefault(request)
@@ -51,21 +53,22 @@
" "
class Item:
- " "
+
def __call__(self, a, b):
return "%s, %s" % (`a`, `b`)
+ def doit(self, a, b):
+ return 'do something %s %s' % (a, b)
+
class View:
- " "
+
def browserDefault(self, request):
return self, ['index']
def index(self, a, b):
- " "
return "%s, %s" % (`a`, `b`)
class Item2:
- " "
view = View()
def browserDefault(self, request):
@@ -92,7 +95,6 @@
return request
def testTraversalToItem(self):
- return
res = self._publisherResults()
self.failUnlessEqual(
res,
@@ -157,6 +159,13 @@
self.assertEqual(response.getBase(),
'http://foobar.com/folder/item2/view/index')
+ def testMethod(self):
+ res = self._publisherResults(
+ {'QUERY_STRING': 'a=5&b:int=6&doit:method=Submit'})
+ res = res.strip().split('\r\n')[-1]
+ self.failUnlessEqual(res, 'do something 5 6')
+
+
def test_suite():
loader = unittest.TestLoader()