Back to index

plone3  3.1.7
utils.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # Copyright (c) 2006 Zope Corporation and Contributors. All Rights
00004 # Reserved.
00005 #
00006 # This software is subject to the provisions of the Zope Public License,
00007 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this
00008 # distribution.
00009 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00010 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00011 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00012 # FOR A PARTICULAR PURPOSE.
00013 #
00014 ##############################################################################
00015 """ PluggableAuthService unit tests utils
00016 
00017 $Id: utils.py 70850 2006-10-20 18:44:07Z jens $
00018 """
00019 
00020 def _setUpDefaultTraversable():
00021     # Work around behavior change in Zope 2.10 due to its use of the 
00022     # Zope 3 pagetemplates
00023     try:
00024         from zope.interface import Interface
00025         from zope.component import provideAdapter
00026         from zope.traversing.interfaces import ITraversable
00027         from zope.traversing.adapters import DefaultTraversable
00028         provideAdapter(DefaultTraversable, (Interface,), ITraversable)
00029     except ImportError:
00030         # Zope < 2.10 - no need to do anything
00031         pass