From 2c85d24d254063183799983c1214e9c3bdd31cfd Mon Sep 17 00:00:00 2001
From: Rafael Monnerat <rafael@nexedi.com>
Date: Sat, 11 Jun 2011 00:04:18 -0300
Subject: [PATCH] Fix text on slapos environment

Use ERP5TypeTestCase API to get hostname and port for memcached.
---
 product/ERP5Type/tests/testMemcachedTool.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/tests/testMemcachedTool.py b/product/ERP5Type/tests/testMemcachedTool.py
index 2e066016d0..36f33f83ea 100644
--- a/product/ERP5Type/tests/testMemcachedTool.py
+++ b/product/ERP5Type/tests/testMemcachedTool.py
@@ -34,6 +34,8 @@ import transaction
 from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
 from AccessControl.SecurityManagement import newSecurityManager
 from Products.ERP5Type.tests.utils import installRealMemcachedTool
+from Products.ERP5Type.tests.ERP5TypeTestCase import\
+    _getVolatileMemcachedServerDict
 import time
 
 class TestMemcachedTool(ERP5TypeTestCase):
@@ -57,17 +59,18 @@ class TestMemcachedTool(ERP5TypeTestCase):
     installRealMemcachedTool(self.getPortal())
     memcached_tool = self.getPortal().portal_memcached
     #create Memcache Plugin
+    url_string = "%(hostname)s:%(port)s" % _getVolatileMemcachedServerDict()
     if getattr(memcached_tool, 'default_memcached_plugin', None) is None:
       memcached_tool.newContent(id='default_memcached_plugin',
                                 portal_type='Memcached Plugin',
                                 int_index=0,
-                                url_string='127.0.0.1:11211')
+                                url_string=url_string)
     if getattr(memcached_tool, 'memcached_plugin_with_expiration', None) is None:
       memcached_tool.newContent(id='memcached_plugin_with_expiration',
                                 portal_type='Memcached Plugin',
                                 int_index=1,
                                 expiration_time=self.expiration_time,
-                                url_string='127.0.0.1:11211')
+                                url_string=url_string)
 
     transaction.commit()
     self.tic()
-- 
2.30.9