[Checkins] SVN: zope.app.publication/trunk/ Reenabled a test which makes sure ``405 MethodNotAllowed`` is returned when PUT is not supported. This requires at least version 3.10 of `zope.app.http`.
Michael Howitz
mh at gocept.com
Tue Jan 25 05:07:39 EST 2011
Log message for revision 119903:
Reenabled a test which makes sure ``405 MethodNotAllowed`` is returned when PUT is not supported. This requires at least version 3.10 of `zope.app.http`.
Changed:
U zope.app.publication/trunk/CHANGES.txt
U zope.app.publication/trunk/setup.py
U zope.app.publication/trunk/src/zope/app/publication/methodnotallowed.txt
-=-
Modified: zope.app.publication/trunk/CHANGES.txt
===================================================================
--- zope.app.publication/trunk/CHANGES.txt 2011-01-25 10:05:29 UTC (rev 119902)
+++ zope.app.publication/trunk/CHANGES.txt 2011-01-25 10:07:38 UTC (rev 119903)
@@ -2,10 +2,14 @@
CHANGES
=======
-3.12.1 (unreleased)
+3.13.0 (unreleased)
-------------------
+- Reenabled a test which makes sure ``405 MethodNotAllowed`` is returned
+ when PUT is not supported. This requires at least version 3.10 of
+ `zope.app.http`.
+
3.12.0 (2010-09-14)
-------------------
Modified: zope.app.publication/trunk/setup.py
===================================================================
--- zope.app.publication/trunk/setup.py 2011-01-25 10:05:29 UTC (rev 119902)
+++ zope.app.publication/trunk/setup.py 2011-01-25 10:07:38 UTC (rev 119903)
@@ -55,8 +55,8 @@
test=['zope.annotation',
'zope.app.appsetup >= 3.14.0',
'zope.app.exception',
- 'zope.app.http',
- 'zope.app.wsgi >= 3.9.0',
+ 'zope.app.http >= 3.10',
+ 'zope.app.wsgi <3.11, >= 3.12',
'zope.applicationcontrol>=3.5.0',
'zope.browserpage',
'zope.login',
Modified: zope.app.publication/trunk/src/zope/app/publication/methodnotallowed.txt
===================================================================
--- zope.app.publication/trunk/src/zope/app/publication/methodnotallowed.txt 2011-01-25 10:05:29 UTC (rev 119902)
+++ zope.app.publication/trunk/src/zope/app/publication/methodnotallowed.txt 2011-01-25 10:07:38 UTC (rev 119903)
@@ -20,13 +20,30 @@
HTTP/1.0 405 Method Not Allowed
...
+Trying to PUT on an object which does not support PUT leads to 405:
-The request below should return 405, but instead crashes with a TypeError,
-when the view tries to adapt context to IWriteFile.
+ >>> print http(r"""
+ ... PUT / HTTP/1.1
+ ... Authorization: Basic mgr:mgrpw
+ ... """)
+ HTTP/1.0 405 Method Not Allowed
+ ...
-# >>> print http(r"""
-# ... PUT / HTTP/1.1
-# ... Authorization: Basic mgr:mgrpw
-# ... """, handle_errors=False)
-# HTTP/1.1 405 Method Not Allowed
-# ...
+Trying to PUT a not existing object on a container which does not support
+PUT leads to 405:
+
+ >>> print http(r"""
+ ... PUT /asdf HTTP/1.1
+ ... Authorization: Basic mgr:mgrpw
+ ... """)
+ HTTP/1.0 405 Method Not Allowed
+ ...
+
+When ``handle_errors`` is set to ``False`` a traceback is displayed:
+
+ >>> print http(r"""
+ ... PUT / HTTP/1.1
+ ... Authorization: Basic mgr:mgrpw
+ ... """, handle_errors=False)
+ Traceback (most recent call last):
+ MethodNotAllowed: <zope.site.folder.Folder object at 0x...>, <zope.publisher.http.HTTPRequest instance URL=http://localhost>
More information about the checkins
mailing list