1- from .. import testing
21from collective .lineage import utils
2+ from collective .lineage .testing import LineageTestCase
33from plone .browserlayer import utils as layer_utils
4- from zope import component
5- from zope import interface
6- from zope .site .hooks import site as site_hook
7-
8- import unittest
4+ from zope .component import getSiteManager
5+ from zope .interface import Interface
96
107PROJECTNAME = "collective.lineage"
118
129
13- class IChildSiteLayer (interface . Interface ):
10+ class IChildSiteLayer (Interface ):
1411 """
1512 An example browser layer for a child site.
1613 """
1714
1815
19- class UtilsTestCase (testing . LineageTestCase ):
16+ class UtilsTestCase (LineageTestCase ):
2017 """
2118 Test the Lineage utility functions.
2219 """
@@ -44,7 +41,7 @@ def test_childsite_browserlayer(self):
4441 layer_utils .register_layer (
4542 IChildSiteLayer ,
4643 "collective.lineage.childsite.layer" ,
47- site_manager = component . getSiteManager (self .childsite ),
44+ site_manager = getSiteManager (self .childsite ),
4845 )
4946
5047 self .assertFalse (
@@ -56,14 +53,3 @@ def test_childsite_browserlayer(self):
5653 IChildSiteLayer .providedBy (self .portal .REQUEST ),
5754 "Child site browser layer not applied to the request" ,
5855 )
59-
60- def test_parent_site_on_siteroot (self ):
61- site = utils .parent_site ()
62- self .assertEqual (site , self .portal )
63-
64- @unittest .skip ("Currently fails, due to `_find_site` always going for aq_parent." )
65- def test_parent_site_on_childsite (self ):
66- utils .enable_childsite (self .childsite )
67- with site_hook (self .childsite ):
68- site = utils .parent_site ()
69- self .assertEqual (site , self .childsite )
0 commit comments