Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_catalog.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_catalog.py	(revision 6430)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_catalog.py	(revision 6430)
@@ -0,0 +1,71 @@
+##
+## test_catalog.py
+## Login : <uli@pu.smp.net>
+## Started on  Mon Jun 20 18:39:12 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
+##
+import shutil
+import tempfile
+import unittest
+from zope.app.testing.functional import (
+    FunctionalTestCase, FunctionalTestSetup, getRootFolder)
+from zope.component.hooks import setSite, clearSite
+from waeup.sirp.app import University
+from waeup.sirp.testing import FunctionalLayer
+from waeup.sirp.accesscodes.accesscodes import AccessCode, AccessCodeBatch
+
+
+class AccessCodeCatalogTests(FunctionalTestCase):
+    # Tests for helpers like get_access_code, disable_accesscode, ...
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(AccessCodeCatalogTests, self).setUp()
+
+        # Prepopulate ZODB
+        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']
+
+        # Create batch
+        batch = AccessCodeBatch('now', 'manfred', 'APP', 6.6, 0)
+        self.app['accesscodes'].addBatch(batch)
+
+        # Fill batch with accesscodes
+        batch.addAccessCode(0, '11111111')
+        batch.addAccessCode(1, '22222222')
+        batch.addAccessCode(2, '33333333')
+        self.ac1 = batch.getAccessCode('APP-1-11111111')
+        self.ac2 = batch.getAccessCode('APP-1-22222222')
+        self.ac3 = batch.getAccessCode('APP-1-33333333')
+
+        setSite(self.app)
+        return
+
+    def tearDown(self):
+        shutil.rmtree(self.dc_root)
+        super(AccessCodeCatalogTests, self).tearDown()
+        return
+
+    def test_blah(self):
+        assert 1 == 0
