Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
91f052e8
Commit
91f052e8
authored
Jul 10, 2007
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't test deprecated APIs (and avoid the resulting DeprecationWarnings).
parent
f52d26b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
30 deletions
+32
-30
lib/python/Products/Five/site/tests/test_localsite.py
lib/python/Products/Five/site/tests/test_localsite.py
+32
-30
No files found.
lib/python/Products/Five/site/tests/test_localsite.py
View file @
91f052e8
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment