Skip to content
This repository has been archived by the owner on Feb 12, 2020. It is now read-only.

Commit

Permalink
Also set Zope2.zpublisher_validated_hook in InstallHook, since the
Browse files Browse the repository at this point in the history
order of execution is different with tests, and it's been already set,
thus our patch has no effect otherwise.
  • Loading branch information
dnouri committed Apr 16, 2009
1 parent 4668153 commit 02f6ef6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -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
----------------------

Expand Down
4 changes: 4 additions & 0 deletions plone/validatehook/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ def InstallHook():
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")

0 comments on commit 02f6ef6

Please sign in to comment.