Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_catalog.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_catalog.py	(revision 6117)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_catalog.py	(revision 6117)
@@ -0,0 +1,67 @@
+##
+## test_catalog.py
+## Login : <uli@pu.smp.net>
+## Started on  Mon May 16 16:15:10 2011 Uli Fouquet
+## $Id$
+## 
+## Copyright (C) 2011 Uli Fouquet
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+## 
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Tests for applicants specific catalog (currently only one).
+"""
+import shutil
+import tempfile
+import unittest
+from zope.app.testing.functional import FunctionalTestCase
+from zope.catalog.interfaces import ICatalog
+from zope.component import getUtility
+from zope.component.hooks import setSite
+from zope.component.interfaces import ComponentLookupError
+from zope.testbrowser.testing import Browser
+from waeup.sirp.app import University
+from waeup.sirp.testing import FunctionalLayer
+
+class CatalogTests(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CatalogTests, 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']
+        self.browser = Browser()
+        self.browser.handleErrors = False
+
+    def tearDown(self):
+        super(CatalogTests, self).tearDown()
+        shutil.rmtree(self.dc_root)
+
+    def test_get_applicants_catalog(self):
+        # There is no global applicants catalog, but one for each site.
+        self.assertRaises(
+            ComponentLookupError,
+            getUtility, ICatalog, name='applicants_catalog')
+        # If we are 'in the local site' we can get an applicants catalog.
+        setSite(self.app)
+        cat = getUtility(ICatalog, name='applicants_catalog')
+        self.assertTrue(ICatalog.providedBy(cat))
