[Checkins] SVN: zc.resourcelibrary/trunk/src/zc/resourcelibrary/ Added test to ensure that the resource library is disabled when no site is set (this happens for instance if request marshalling fails).r
Malthe Borch
mborch at gmail.com
Tue May 5 08:50:50 EDT 2009
Log message for revision 99772:
Added test to ensure that the resource library is disabled when no site is set (this happens for instance if request marshalling fails).r
Changed:
U zc.resourcelibrary/trunk/src/zc/resourcelibrary/README.txt
U zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py
-=-
Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/README.txt
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/README.txt 2009-05-05 12:46:42 UTC (rev 99771)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/README.txt 2009-05-05 12:50:50 UTC (rev 99772)
@@ -168,7 +168,6 @@
>>> '/@@/my-lib/included.js' in zpt(page, view=View())
True
-
Content-type checking
---------------------
@@ -326,6 +325,22 @@
>>> browser.contents.count('src="http://localhost/@@/my-lib/included.js"')
1
+Error during publishing
+-----------------------
+
+Note that in case an exception is raised during publishing, the
+resource library is disabled.
+
+ >>> browser.handleErrors = True
+ >>> browser.post(
+ ... 'http://localhost/zc.resourcelibrary.test_template_5',
+ ... 'value:int=dummy', 'multipart/form-data')
+ Traceback (most recent call last):
+ ...
+ HTTPError: ...
+ >>> '/@@/my-lib/included.js' in browser.contents
+ False
+
Custom "directory" factories
----------------------------
Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py 2009-05-05 12:46:42 UTC (rev 99771)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py 2009-05-05 12:50:50 UTC (rev 99772)
@@ -104,7 +104,7 @@
# generate the HTML that will be included in the response
site = getSite()
if site is None:
- return None
+ return
# look up resources view factory
factory = getSiteManager().adapters.lookup(
More information about the Checkins
mailing list