From 8a5f4dc0b295475481ee3d8f1c5d1b999116fd6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Mon, 23 Aug 2010 06:28:31 +0000
Subject: [PATCH]  - removes hack by inverting logic - find portal object by
 checking objects    meta type and then using such portal object to fetch its
 id

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37934 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/tests/ERP5TypeLiveTestCase.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/tests/ERP5TypeLiveTestCase.py b/product/ERP5Type/tests/ERP5TypeLiveTestCase.py
index 7c8ebd926d..7111140cd3 100644
--- a/product/ERP5Type/tests/ERP5TypeLiveTestCase.py
+++ b/product/ERP5Type/tests/ERP5TypeLiveTestCase.py
@@ -80,12 +80,15 @@ class ERP5TypeLiveTestCase(ProcessingNodeTestCase, PortalTestCase):
     def getPortalName(self):
       """ Return the default ERP5 site id.
       """
-      return 'erp5' # XXX-JPS For now a hack
+      return self.getPortalObject().getId()
 
     def getPortal(self):
       """Returns the portal object, i.e. the "fixture root".
       """
-      return self.app[self.getPortalName()]
+      # Assumes that portal exists (which has sense) and that there is only one
+      # ERP5 site in Zope (which is always the case)
+      return [q for q in self.app.objectValues() if q.meta_type == 'ERP5 Site'
+          ][0]
 
     getPortalObject = getPortal
 
-- 
2.30.9