diff --git a/product/ERP5Type/tests/testCache.py b/product/ERP5Type/tests/testCache.py index 21ba91614cea6145404ea1176e0fd965b4b3933f..1342fd046edfc5fc9b213d8a0b086a72144e68cd 100644 --- a/product/ERP5Type/tests/testCache.py +++ b/product/ERP5Type/tests/testCache.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved. @@ -50,8 +51,10 @@ class TestRamCache(unittest.TestCase): def setUp(self): self.cache_plugins = (RamCache(), DistributedRamCache({'server': '127.0.0.1:11211', - 'debugLevel': 7,}), - ) + 'debug_level': 7, + 'server_max_key_length': 250, + 'server_max_value_length': 1048576,}), + ) def testScope(self): """ test scope functions """ @@ -167,7 +170,7 @@ class TestRamCache(unittest.TestCase): ## check get() cache_entry = cache_plugin.get(cache_id, scope) if isinstance(value, Foo): - ## with memcached, we have a new object created for user + ## when memcached, we have a new object created for user ## just compare one field from it self.assertEqual(value.my_field, cache_entry.getValue().my_field) else: diff --git a/product/ERP5Type/tests/testMemcachedTool.py b/product/ERP5Type/tests/testMemcachedTool.py index ea6ae142bcd7419b830d32ee2305e9475798a3cd..3296320e8601f7493abfb6aa9364b987e056e0d9 100644 --- a/product/ERP5Type/tests/testMemcachedTool.py +++ b/product/ERP5Type/tests/testMemcachedTool.py @@ -55,7 +55,8 @@ class TestMemcachedTool(ERP5TypeTestCase): memcached_tool = self.getPortal().portal_memcached #create Memcache Plugin if getattr(memcached_tool, 'default_memcached_plugin', None) is None: - memcached_tool.newContent(portal_type='Memcached Plugin', + memcached_tool.newContent(id='default_memcached_plugin', + portal_type='Memcached Plugin', int_index=0, url_string='127.0.0.1:11211') transaction.commit() @@ -71,7 +72,8 @@ class TestMemcachedTool(ERP5TypeTestCase): newSecurityManager(None, user) def getMemcachedDict(self): - return self.getPortal().portal_memcached.getMemcachedDict(key_prefix='unit_test') + return self.getPortal().portal_memcached.getMemcachedDict(key_prefix='unit_test', + plugin_path='portal_memcached/default_memcached_plugin') def test_00_MemcachedToolIsEnabled(self): """ @@ -87,11 +89,7 @@ class TestMemcachedTool(ERP5TypeTestCase): import memcache except ImportError: # MemcachedTool should be disabled - self.assertRaises(RuntimeError, memcached_tool.getServerAddressList) - else: - # MemcachedTool should be enabled - self.assertTrue(isinstance(memcached_tool.getServerAddressList(), - list)) + self.assertRaises(RuntimeError, memcached_tool.getMemcachedDict) def test_01_dictionnaryIsUsable(self): """