[Zope3-checkins] CVS: Zope3/src/zope/publisher/tests - test_http.py:1.3
Jim Fulton
jim@zope.com
Fri, 7 Feb 2003 10:41:23 -0500
Update of /cvs-repository/Zope3/src/zope/publisher/tests
In directory cvs.zope.org:/tmp/cvs-serv21463
Modified Files:
test_http.py
Log Message:
Added the "method" attribute to store the HTTP request method.
=== Zope3/src/zope/publisher/tests/test_http.py 1.2 => 1.3 ===
--- Zope3/src/zope/publisher/tests/test_http.py:1.2 Wed Dec 25 09:15:19 2002
+++ Zope3/src/zope/publisher/tests/test_http.py Fri Feb 7 10:41:23 2003
@@ -18,6 +18,7 @@
from zope.publisher.publish import publish
from zope.publisher.base import DefaultPublication
+from zope.publisher.interfaces.http import IHTTPPresentation
from zope.interface.verify import verifyObject
from zope.interface.implements import instancesOfObjectImplements
@@ -145,11 +146,17 @@
# test the IView request
r = self._createRequest()
- self.failUnless( r.getPresentationType() is None)
- self.assertEqual( r.getPresentationSkin(), '')
+ self.assertEquals(r.getPresentationType(), IHTTPPresentation)
+ self.assertEqual(r.getPresentationSkin(), '')
r.setViewSkin( 'morefoo' )
self.assertEqual( r.getPresentationSkin(), 'morefoo')
+ def test_method(self):
+ r = self._createRequest(extra_env={'REQUEST_METHOD':'SPAM'})
+ self.assertEqual(r.method, 'SPAM')
+ r = self._createRequest(extra_env={'REQUEST_METHOD':'eggs'})
+ self.assertEqual(r.method, 'EGGS')
+
def test_suite():
loader = unittest.TestLoader()