def _initSite(self, with_policy=False): site = Folder(id='site').__of__(self.app) cpm = CachingPolicyManager() getSiteManager().registerUtility(cpm, ICachingPolicyManager) if with_policy: cpm.addPolicy(policy_id=self.POLICY_ID, predicate=self.PREDICATE, mtime_func=self.MTIME_FUNC, max_age_secs=self.MAX_AGE_SECS, no_cache=True, no_store=True, must_revalidate=True, vary=self.VARY, etag_func=self.ETAG_FUNC, s_max_age_secs=self.S_MAX_AGE_SECS, proxy_revalidate=True, public=True, private=True, no_transform=True, enable_304s=True, last_modified=False, pre_check=self.PRE_CHECK, post_check=self.POST_CHECK) return site, cpm
def _initSite(self, with_policy=False): from Products.CMFCore.CachingPolicyManager import CachingPolicyManager self.root.site = Folder(id='site') site = self.root.site mgr = CachingPolicyManager() site._setObject(mgr.getId(), mgr) if with_policy: mgr.addPolicy(policy_id=self.POLICY_ID, predicate=self.PREDICATE, mtime_func=self.MTIME_FUNC, max_age_secs=self.MAX_AGE_SECS, no_cache=True, no_store=True, must_revalidate=True, vary=self.VARY, etag_func=self.ETAG_FUNC, s_max_age_secs=self.S_MAX_AGE_SECS, proxy_revalidate=True, public=True, private=True, no_transform=True, enable_304s=True, last_modified=False, pre_check=self.PRE_CHECK, post_check=self.POST_CHECK) return site
def setUp(self): import Products.CMFCore.exportimport from Products.CMFCore.CachingPolicyManager import CachingPolicyManager BodyAdapterTestCase.setUp(self) zcml.load_config('configure.zcml', Products.CMFCore.exportimport) self._obj = CachingPolicyManager() self._BODY = _CPM_BODY
def setUp(self): from Products.CMFCore.CachingPolicyManager import CachingPolicyManager self._obj = CachingPolicyManager() self._BODY = _CPM_BODY
def _makeOne(self): from Products.CMFCore.CachingPolicyManager import CachingPolicyManager return CachingPolicyManager()
def setUp(self): from Products.CMFCore.CachingPolicyManager import CachingPolicyManager BodyAdapterTestCase.setUp(self) self._obj = CachingPolicyManager() self._BODY = _CPM_BODY
def setUp(self): self._obj = CachingPolicyManager() self._BODY = _CPM_BODY
def _makeOne(self): return CachingPolicyManager()