Skip to content

Commit

Permalink
Tweak reST/STX dependent tests so that they pass on both the
Browse files Browse the repository at this point in the history
Zope 2.8 and the X3.0 release line. These are the tests that
were previously disabled on the Zope-X3.0.0-2.8 branch
(except for the access log test which seems to pass now.)
  • Loading branch information
philikon committed Jul 26, 2005
1 parent ac9c7da commit 2392f90
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
24 changes: 16 additions & 8 deletions classmodule/browser.py
Expand Up @@ -574,8 +574,13 @@ def getDoc(self):
>>> from tests import getClassDetailsView
>>> view = getClassDetailsView()
>>> print view.getDoc()[23:80]
<p>Represent the Documentation of any possible class.</p>
We need to be a little weird about this test here because
reST/STX behaviour changes from Zope X3.0 to Zope 2.8 (which
X3.0 is a part of):
>>> '<p>Represent the Documentation of any possible class.</p>' \\
... in view.getDoc()
True
"""
return renderText(self.context.getDocString() or '',
zapi.getParent(self.context).getPath())
Expand All @@ -594,12 +599,15 @@ def getDoc(self):
>>> from tests import getModuleDetailsView
>>> view = getModuleDetailsView()
>>> print view.getDoc().strip()
<div class="document">
<p>Class Documentation Module</p>
<p>This module is able to take a dotted name of any class and display
documentation for it.</p>
</div>
We need to be a little weird about this test here because
reST/STX behaviour changes from Zope X3.0 to Zope 2.8 (which
X3.0 is a part of):
>>> '''\\
... <p>Class Documentation Module</p>
... <p>This module is able to take a dotted name of any class and display
... documentation for it.</p>''' in view.getDoc().strip()
True
"""
text = self.context.getDocString()
if text is None:
Expand Down
2 changes: 1 addition & 1 deletion classmodule/tests.py
Expand Up @@ -111,4 +111,4 @@ def test_suite():
))

if __name__ == '__main__':
unittest.main()
unittest.main(defaultTest='test_suite')
9 changes: 7 additions & 2 deletions ifacemodule/browser.py
Expand Up @@ -240,8 +240,13 @@ def getDoc(self):
>>> from tests import getInterfaceDetails
>>> details = getInterfaceDetails()
>>> details.getDoc()[:55]
'<div class="document">\n<p>This is the Foo interface</p>'
We need to be a little weird about this test here because
reST/STX behaviour changes from Zope X3.0 to Zope 2.8 (which
X3.0 is a part of):
>>> '<p>This is the Foo interface</p>' in details.getDoc()
True
"""
# We must remove all proxies here, so that we get the context's
# __module__ attribute. If we only remove security proxies, the
Expand Down
5 changes: 2 additions & 3 deletions ifacemodule/tests.py
Expand Up @@ -80,7 +80,6 @@ class IBar(Interface):
class Foo(object):
implements(IFoo)


def getInterfaceDetails():
ifacemodule = InterfaceModule()
ifacemodule.__parent__ = Root()
Expand All @@ -90,7 +89,7 @@ def getInterfaceDetails():
view.context = iface
view.request = TestRequest()
return view


def setUp(test):
placelesssetup.setUp()
Expand Down Expand Up @@ -133,4 +132,4 @@ def test_suite():
))

if __name__ == '__main__':
unittest.main()
unittest.main(defaultTest='test_suite')

0 comments on commit 2392f90

Please sign in to comment.