Changeset 5865 for main/waeup.sirp/trunk


Ignore:
Timestamp:
14 Mar 2011, 07:39:17 (14 years ago)
Author:
uli
Message:

Make the zope.Public permission available during regular unittests.

This permission is normally registered during ZCML parsing at startup,
but we cannot grok components with that requirement set in normal
unittests, as they simply perform no ZCML parsing at start.

With defining zope.Public we can also grok waeup.sirp in unittests and
define components that require that permission.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/testing.py

    r5796 r5865  
    88from zope.app.testing.functional import ZCMLLayer
    99from zope.component import getGlobalSiteManager
     10from zope.security.testing import addCheckerPublic
    1011from zope.testing.cleanup import cleanUp
    1112
     
    118119    if len(list(gsm.registeredHandlers())) > 0:
    119120        return False
     121    # Register the zope.Public permission, normally done via ZCML setup.
     122    addCheckerPublic()
    120123    warnings.simplefilter('ignore') # disable (erraneous) warnings
    121124    grok.testing.grok('waeup.sirp')
     
    161164    @classmethod
    162165    def setUp(cls):
     166        #setUpZope(None)
    163167        grokked = maybe_grok()
    164168        if grokked:
    165             setUpZope(None)
     169            pass
     170            #setUpZope(None)
    166171        return
    167172
Note: See TracChangeset for help on using the changeset viewer.