Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_root.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_root.py	(revision 6119)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_root.py	(revision 6120)
@@ -24,6 +24,9 @@
 """
 import logging
+import shutil
+import tempfile
 import unittest
 from StringIO import StringIO
+from zope.app.testing.functional import FunctionalTestCase
 from zope.component.hooks import setSite, clearSite
 from zope.interface.verify import verifyClass, verifyObject
@@ -37,5 +40,7 @@
     ApplicantsRoot, ApplicantsPlugin,
     )
-from waeup.sirp.testing import WAeUPSIRPUnitTestLayer
+from waeup.sirp.testing import FunctionalLayer
+
+
 
 
@@ -149,27 +154,36 @@
         return
 
-applicant = Applicant()
-fake_apps = {
-    'cest10' : ApplicantsContainer(),
-    'cest11' : ApplicantsContainer(),
-    }
-
-fake_apps['cest10']['APP-99999'] = applicant
-
-class HelperToolsTest(unittest.TestCase):
-
-    layer = WAeUPSIRPUnitTestLayer
-    
+
+class HelperToolsTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
     def setUp(self):
-        self.app = University()
-        # Insert some applicants...
-        for container, data in fake_apps.items():
-            self.app['applicants'][container] = data
-        self.app.setSiteManager(LocalSiteManager(self.app))
+        super(HelperToolsTest, self).setUp()
+
+        # Setup a sample site for each test
+        app = University()
+        self.dc_root = tempfile.mkdtemp()
+        app['datacenter'].setStoragePath(self.dc_root)
+
+        # Prepopulate the ZODB...
+        self.getRootFolder()['app'] = app
+        self.app = self.getRootFolder()['app']
         setSite(self.app)
+
+        # Insert some applicants containers and applicants...
+        self.container1 = ApplicantsContainer()
+        self.app['applicants']['foo'] = self.container1
+        self.container2 = ApplicantsContainer()
+        self.app['applicants']['bar'] = self.container2
+        self.ac = u'APP-99999'
+        self.applicant = Applicant()
+        self.applicant.access_code = self.ac
+        self.app['applicants']['foo'][self.ac] = self.applicant
         return
 
     def tearDown(self):
-        clearSite()
+        super(HelperToolsTest, self).tearDown()
+        shutil.rmtree(self.dc_root)
         return
 
@@ -184,5 +198,5 @@
     def test_get_applicant_data(self):
         result = get_applicant_data('APP-99999')
-        self.assertEqual(result, applicant)
+        self.assertEqual(result, self.applicant)
         return
 
@@ -191,5 +205,5 @@
         assert result is None
         return
-    
+
 def suite():
     suite = unittest.TestSuite()
