[Checkins] SVN: plone.validatehook/trunk/ Also set ``Zope2.zpublisher_validated_hook`` in InstallHook, since the
Daniel Nouri
daniel.nouri at gmail.com
Thu Apr 16 11:53:19 EDT 2009
Log message for revision 99218:
Also set ``Zope2.zpublisher_validated_hook`` in InstallHook, since the
order of execution is different with tests, and it's been already set,
thus our patch has no effect otherwise.
Changed:
U plone.validatehook/trunk/docs/HISTORY.txt
U plone.validatehook/trunk/plone/validatehook/hook.py
-=-
Modified: plone.validatehook/trunk/docs/HISTORY.txt
===================================================================
--- plone.validatehook/trunk/docs/HISTORY.txt 2009-04-16 15:12:52 UTC (rev 99217)
+++ plone.validatehook/trunk/docs/HISTORY.txt 2009-04-16 15:53:18 UTC (rev 99218)
@@ -1,6 +1,13 @@
Changelog
=========
+trunk
+-----
+
+* Also set ``Zope2.zpublisher_validated_hook`` in InstallHook, since
+ the order of execution is different with tests, and it's been
+ already set, thus our patch has no effect otherwise.
+
1.0 - October 15, 2008
----------------------
Modified: plone.validatehook/trunk/plone/validatehook/hook.py
===================================================================
--- plone.validatehook/trunk/plone/validatehook/hook.py 2009-04-16 15:12:52 UTC (rev 99217)
+++ plone.validatehook/trunk/plone/validatehook/hook.py 2009-04-16 15:53:18 UTC (rev 99218)
@@ -26,9 +26,13 @@
Note that we can not change Zope2.zpublisher_validated_hook since
the Zope startup code sets that *after* product initialization.
+ However, when testing (presumably with ZopeTestCase) we need to
+ set it because it's already set.
"""
+ import Zope2
from Zope2.App import startup
startup.validated_hook=ValidateHookWrapper(startup.validated_hook)
+ Zope2.zpublisher_validated_hook = startup.validated_hook
logger.info("Wrapped the Zope2 zpublisher validation hook")
More information about the Checkins
mailing list