Esempio n. 1
0
 def _resetRAMCache(self):
     '''Resets memoize RAMCaches.'''
     from plone.memoize.ram import global_cache
     global_cache.invalidateAll()
     from zope.component import queryUtility
     from plone.memoize.ram import IRAMCache
     cache = queryUtility(IRAMCache)
     if cache is not None:
         cache.invalidateAll()
Esempio n. 2
0
    def tearDownEnvironment(self, portal):
        """Log out, invalidate standard RAM caches, and unset the local
        component site to clean up after tests.
        """

        # Clear the security manager
        from plone.app.testing import helpers
        helpers.logout()

        # Clear any cached data using plone.memoize's RAM caches
        from plone.memoize.ram import global_cache
        global_cache.invalidateAll()

        from zope.component import queryUtility
        from plone.memoize.ram import IRAMCache
        cache = queryUtility(IRAMCache)
        if cache and getattr(cache, '_cacheId', None):
            cache.invalidateAll()

        # Unset the local component site
        setSite(None)
Esempio n. 3
0
    def tearDownEnvironment(self, portal):
        """Log out, invalidate standard RAM caches, and unset the local
        component site to clean up after tests.
        """

        # Clear the security manager
        from plone.app.testing import helpers
        helpers.logout()

        # Clear any cached data using plone.memoize's RAM caches
        from plone.memoize.ram import global_cache
        global_cache.invalidateAll()

        from zope.component import queryUtility
        from plone.memoize.ram import IRAMCache
        cache = queryUtility(IRAMCache)
        if cache is not None:
            cache.invalidateAll()

        # Unset the local component site
        from zope.site.hooks import setSite
        setSite(None)