Commit 91f052e8 authored by Stefan H. Holek's avatar Stefan H. Holek

Don't test deprecated APIs (and avoid the resulting DeprecationWarnings).

parent f52d26b7
...@@ -116,36 +116,38 @@ class SiteManagerTest(PlacelessSetup, unittest.TestCase): ...@@ -116,36 +116,38 @@ class SiteManagerTest(PlacelessSetup, unittest.TestCase):
setSite(self.f2) setSite(self.f2)
self.assertEqual(getSiteManager(None), self.sm2) self.assertEqual(getSiteManager(None), self.sm2)
def test_queryNextSiteManager(self): # DEPRECATED in Zope 3.4
from zope.app.component import queryNextSiteManager #def test_queryNextSiteManager(self):
marker = object() # from zope.app.component import queryNextSiteManager
self.assert_(queryNextSiteManager(self.root, marker) is marker) # marker = object()
self.assert_(queryNextSiteManager(self.f1, marker) is getGlobalSiteManager()) # self.assert_(queryNextSiteManager(self.root, marker) is marker)
self.assertEqual(queryNextSiteManager(self.f2, marker), self.sm1) # self.assert_(queryNextSiteManager(self.f1, marker) is getGlobalSiteManager())
self.assertEqual(queryNextSiteManager(self.sm1), getGlobalSiteManager()) # self.assertEqual(queryNextSiteManager(self.f2, marker), self.sm1)
self.assertEqual(queryNextSiteManager(self.sm2), self.sm1) # self.assertEqual(queryNextSiteManager(self.sm1), getGlobalSiteManager())
self.assert_(queryNextSiteManager(self.p1, marker) is marker) # self.assertEqual(queryNextSiteManager(self.sm2), self.sm1)
self.assert_(queryNextSiteManager(self.p2, marker) is marker) # self.assert_(queryNextSiteManager(self.p1, marker) is marker)
# self.assert_(queryNextSiteManager(self.p2, marker) is marker)
self.assert_(queryNextSiteManager(self.unparented_folder, marker) #
is marker) # self.assert_(queryNextSiteManager(self.unparented_folder, marker)
self.assert_(queryNextSiteManager(self.unrooted_subfolder, marker) # is marker)
is marker) # self.assert_(queryNextSiteManager(self.unrooted_subfolder, marker)
# is marker)
def test_getNextSiteManager(self):
from zope.app.component import getNextSiteManager # DEPRECATED in Zope 3.4
self.assertRaises(ComponentLookupError, getNextSiteManager, self.root) #def test_getNextSiteManager(self):
self.assertEqual(getNextSiteManager(self.f1), getGlobalSiteManager()) # from zope.app.component import getNextSiteManager
self.assertEqual(getNextSiteManager(self.f2), self.sm1) # self.assertRaises(ComponentLookupError, getNextSiteManager, self.root)
self.assertEqual(getNextSiteManager(self.sm1), getGlobalSiteManager()) # self.assertEqual(getNextSiteManager(self.f1), getGlobalSiteManager())
self.assertEqual(getNextSiteManager(self.sm2), self.sm1) # self.assertEqual(getNextSiteManager(self.f2), self.sm1)
self.assertRaises(ComponentLookupError, getNextSiteManager, self.p1) # self.assertEqual(getNextSiteManager(self.sm1), getGlobalSiteManager())
self.assertRaises(ComponentLookupError, getNextSiteManager, self.p2) # self.assertEqual(getNextSiteManager(self.sm2), self.sm1)
# self.assertRaises(ComponentLookupError, getNextSiteManager, self.p1)
self.assertRaises(ComponentLookupError, # self.assertRaises(ComponentLookupError, getNextSiteManager, self.p2)
getNextSiteManager, self.unparented_folder) #
self.assertRaises(ComponentLookupError, # self.assertRaises(ComponentLookupError,
getNextSiteManager, self.unrooted_subfolder) # getNextSiteManager, self.unparented_folder)
# self.assertRaises(ComponentLookupError,
# getNextSiteManager, self.unrooted_subfolder)
# XXX Maybe we need to test this with RestrictedPython in the context # XXX Maybe we need to test this with RestrictedPython in the context
# of Zope2? Maybe we just don't care. # of Zope2? Maybe we just don't care.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment