Navigation Menu

Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Use getSite from zope.component
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed May 20, 2012
1 parent 79a4144 commit 2a38e8a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
4 changes: 3 additions & 1 deletion CHANGES.txt
Expand Up @@ -4,6 +4,9 @@ Changelog
0.9.12 - Unreleased
-------------------

- Use getSite from zope.component.
[hannosch]

0.9.11 - 2010-09-20
-------------------

Expand All @@ -12,7 +15,6 @@ Changelog
Zope2.App.zcml or Products.Five.zcml.
[davisagli]


0.9.10 - 2010-07-13
-------------------

Expand Down
10 changes: 1 addition & 9 deletions Products/CMFTestCase/five.py
Expand Up @@ -5,15 +5,7 @@
# $Id$

from __future__ import nested_scopes

try:
from zope.testing.cleanup import cleanUp as _cleanUp
except ImportError:
try:
from zope.app.testing.placelesssetup import tearDown as _cleanUp
except ImportError:
# Zope < 2.8
def _cleanUp(): pass
from zope.testing.cleanup import cleanUp as _cleanUp


def cleanUp():
Expand Down
11 changes: 2 additions & 9 deletions Products/CMFTestCase/setup.py
Expand Up @@ -307,11 +307,7 @@ def run(self):

def _placefulSetUp(portal):
'''Sets the local site/manager.'''
try:
from zope.site.hooks import setHooks, setSite
except ImportError:
from zope.app.component.hooks import setHooks, setSite

from zope.component.hooks import setHooks, setSite
from zope.component.interfaces import ComponentLookupError
setHooks()
try:
Expand All @@ -322,10 +318,7 @@ def _placefulSetUp(portal):

def _placefulTearDown():
'''Resets the local site/manager.'''
try:
from zope.site.hooks import resetHooks, setSite
except ImportError:
from zope.app.component.hooks import resetHooks, setSite
from zope.component.hooks import resetHooks, setSite

resetHooks()
setSite()
Expand Down
2 changes: 1 addition & 1 deletion Products/CMFTestCase/testCMFTestCase.py
Expand Up @@ -58,7 +58,7 @@ def testSkinScript(self):
if CMFTestCase.CMF21:

def testGetSite(self):
from zope.app.component.hooks import getSite
from zope.component.hooks import getSite
self.failUnless(aq_base(getSite()) is aq_base(self.portal))


Expand Down

0 comments on commit 2a38e8a

Please sign in to comment.