From 8395982fdfd8127029b025c9617416d6dfae0a81 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Tue, 10 Sep 2013 15:24:27 +0200
Subject: [PATCH] explicitly specify minimal cache factories to be cleared.

---
 product/ERP5/tests/testAuthenticationPolicy.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/tests/testAuthenticationPolicy.py b/product/ERP5/tests/testAuthenticationPolicy.py
index 0a1512c689..3ad09be07d 100644
--- a/product/ERP5/tests/testAuthenticationPolicy.py
+++ b/product/ERP5/tests/testAuthenticationPolicy.py
@@ -88,8 +88,10 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
       self.tic()
 
   def _clearCache(self):
-    for cache_factory in [x for x in self.portal.portal_caches.getCacheFactoryList() if x!="erp5_session_cache"]:
-      self.portal.portal_caches.clearCacheFactory(cache_factory)
+    self.portal.portal_caches.clearCache(
+      cache_factory_list=('erp5_ui_short', # for preference cache
+                          'erp5_content_short', # for authentication cache
+                          ))
 
   def _getPasswordEventList(self, person):
     return [x.getObject() for x in self.portal.portal_catalog(
-- 
2.30.9