Commit 255d3227 authored by Ivan Tyagov's avatar Ivan Tyagov Committed by Julien Muchembled

portal_caches tool is expected to allow only Cache Factory instances inside

parent b031c0e4
......@@ -29,7 +29,6 @@
<item>Ram Cache</item>
</portal_type>
<portal_type id="Cache Tool">
<item>Cache Bag</item>
<item>Cache Factory</item>
</portal_type>
<portal_type id="Category">
......
......@@ -11,7 +11,6 @@ Cache Bag | Ram Cache
Cache Factory | Cache Bag
Cache Factory | Distributed Ram Cache
Cache Factory | Ram Cache
Cache Tool | Cache Bag
Cache Tool | Cache Factory
Category Tool | Base Category
Category | Category
......
......@@ -44,11 +44,11 @@ class TestDocumentWithFlare(TestDocument):
def setSystemPreference(self):
system_preference = TestDocument.setSystemPreference(self)
memcached = _getPersistentMemcachedServerDict()
# create a Cache Bag for tests
cache_bag = self.portal.portal_caches.newContent(portal_type = 'Cache Bag')
cache_bag.cache_duration = 15768000
cache_plugin = cache_bag.newContent(portal_type='Distributed Ram Cache')
system_preference.setPreferredConversionCacheFactory(cache_bag.getId())
# create a Cache Factory for tests
cache_factory = self.portal.portal_caches.newContent(portal_type = 'Cache Factory')
cache_factory.cache_duration = 15768000
cache_plugin = cache_factory.newContent(portal_type='Distributed Ram Cache')
system_preference.setPreferredConversionCacheFactory(cache_factory.getId())
persistent_memcached_plugin = self.portal.portal_memcached.persistent_memcached_plugin
persistent_memcached_plugin.setUrlString('%s:%s' %(memcached['hostname'], memcached['port']))
cache_plugin.setSpecialiseValue(persistent_memcached_plugin)
......
......@@ -49,11 +49,11 @@ class TestIngestionWithFlare(TestIngestion):
def setSystemPreference(self):
default_pref = self.portal.portal_preferences.default_site_preference
memcached = _getPersistentMemcachedServerDict()
# create a Cache Bag for tests
cache_bag = self.portal.portal_caches.newContent(portal_type = 'Cache Bag')
cache_bag.cache_duration = 15768000
cache_plugin = cache_bag.newContent(portal_type='Distributed Ram Cache')
default_pref.setPreferredConversionCacheFactory(cache_bag.getId())
# create a Cache Factory for tests
cache_factory = self.portal.portal_caches.newContent(portal_type = 'Cache Factory')
cache_factory.cache_duration = 15768000
cache_plugin = cache_factory.newContent(portal_type='Distributed Ram Cache')
default_pref.setPreferredConversionCacheFactory(cache_factory.getId())
persistent_memcached_plugin = self.portal.portal_memcached.persistent_memcached_plugin
persistent_memcached_plugin.setUrlString('%s:%s' %(memcached['hostname'], memcached['port']))
cache_plugin.setSpecialiseValue(persistent_memcached_plugin)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment