Skip to content

Commit

Permalink
Use zapi.isinstance() as appropriate.
Browse files Browse the repository at this point in the history
Always use zapi.isinstance(o) instead of isinstance(removeSecurityProxy(o))
when the unproxied object is not otherwise needed.
  • Loading branch information
freddrake committed Sep 1, 2004
1 parent f026f20 commit 22e7213
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/test_factory.py
Expand Up @@ -21,7 +21,6 @@
from zope.configuration.xmlconfig import xmlconfig
from zope.configuration.xmlconfig import XMLConfig
from zope.component import createObject
from zope.security.proxy import removeSecurityProxy
from zope.app.tests.placelesssetup import PlacelessSetup

from zope.app import zapi
Expand Down Expand Up @@ -64,9 +63,7 @@ def testFactory(self):
</content>''')
xmlconfig(f)
obj = createObject(None, 'test.Example')
# isinstance() doesn't work with proxies, so remove if present
obj = removeSecurityProxy(obj)
self.failUnless(isinstance(obj, ExampleClass))
self.failUnless(zapi.isinstance(obj, ExampleClass))

def test_suite():
loader=unittest.TestLoader()
Expand Down

0 comments on commit 22e7213

Please sign in to comment.