Index: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6622)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6626)
@@ -73,5 +73,5 @@
         self.container_path = 'http://localhost/app/students'
         self.manage_container_path = self.container_path + '/@@manage'
-        self.add_student_path = self.container_path + '/@@add'
+        self.add_student_path = self.container_path + '/addstudent'
 
         # Populate university
@@ -121,11 +121,9 @@
         return
 
-    def test_add_students(self):
-        # Managers can add students
+    def test_add_search_delete_students(self):
+        # Managers can add search and remove students
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        self.add_student_path = self.container_path + '/addstudent'
-        self.container_manage_path = self.container_path + '/@@manage'
-        self.browser.open(self.container_manage_path)
-        self.browser.getControl("Add student").click()
+        self.browser.open(self.manage_container_path)
+        self.browser.getLink("Add student").click()
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
         self.assertEqual(self.browser.url, self.add_student_path)
@@ -133,2 +131,37 @@
         self.browser.getControl(name="form.name").value = 'Bob Tester'
         self.browser.getControl("Create student record").click()
+        self.assertTrue('Student record created' in self.browser.contents)
+
+        self.browser.open(self.container_path)
+        self.browser.getControl("Search").click()
+        self.assertTrue('Empty search string' in self.browser.contents)
+        self.browser.getControl(name="searchtype").value = ['student_id']
+        self.browser.getControl(name="searchterm").value = 'A123456'
+        self.browser.getControl("Search").click()
+        self.assertTrue('Bob Tester' in self.browser.contents)
+        # The old searchterm will be used again
+        self.browser.getControl("Search").click()
+        self.assertTrue('Bob Tester' in self.browser.contents)
+
+        self.browser.open(self.manage_container_path)
+        self.browser.getControl("Search").click()
+        self.assertTrue('Empty search string' in self.browser.contents)
+        self.browser.getControl(name="searchtype").value = ['name']
+        self.browser.getControl(name="searchterm").value = 'Bob Tester'
+        self.browser.getControl("Search").click()
+        self.assertTrue('A123456' in self.browser.contents)
+        ctrl = self.browser.getControl(name='entries')
+        ctrl.getControl(value='A123456').selected = True
+        self.browser.getControl("Remove selected", index=0).click()
+        self.assertTrue('Successfully removed' in self.browser.contents)
+        self.browser.getControl(name="searchtype").value = ['student_id']
+        self.browser.getControl(name="searchterm").value = 'A123456'
+        self.browser.getControl("Search").click()
+        self.assertTrue('No student found' in self.browser.contents)
+
+        self.browser.open(self.container_path)
+        self.browser.getControl(name="searchtype").value = ['student_id']
+        self.browser.getControl(name="searchterm").value = 'A123456'
+        self.browser.getControl("Search").click()
+        self.assertTrue('No student found' in self.browser.contents)
+
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_catalog.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_catalog.py	(revision 6626)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_catalog.py	(revision 6626)
@@ -0,0 +1,88 @@
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## 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.catalog.interfaces import ICatalog
+from zope.component import queryUtility, getUtility
+from zope.component.hooks import setSite, clearSite
+from zope.interface.verify import verifyClass, verifyObject
+from hurry.query.interfaces import IQuery
+from hurry.query import Eq
+from waeup.sirp.app import University
+from waeup.sirp.interfaces import IQueryResultItem
+from waeup.sirp.testing import FunctionalLayer
+from waeup.sirp.students.students import Student
+#from waeup.sirp.students.workflow import INITIALIZED, USED, DISABLED
+from waeup.sirp.students.catalog import StudentQueryResultItem, search
+
+class CatalogTestSetup(FunctionalTestCase):
+    # A setup for testing students catalog related stuff.
+    #
+    # sets up a site with some student already created.
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CatalogTestSetup, 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']
+        setSite(self.app)
+
+        # Create students
+        student = Student()
+        student.name = u'Bob Tester'
+        student.student_id = u'A123456'
+        self.app['students'][student.student_id] = student
+        return
+
+    def tearDown(self):
+        shutil.rmtree(self.dc_root)
+        super(CatalogTestSetup, self).tearDown()
+        return
+
+class StudentCatalogTests(CatalogTestSetup):
+
+    layer = FunctionalLayer
+
+    def test_get_catalog(self):
+        # We can get an students catalog if we wish
+        cat = queryUtility(ICatalog, name='students_catalog')
+        assert cat is not None
+
+    def test_search_by_id(self):
+        # We can find a certain student id
+        cat = queryUtility(ICatalog, name='students_catalog')
+        results = cat.searchResults(student_id=('A123456', 'A123456'))
+        results = [x for x in results] # Turn results generator into list
+        assert len(results) == 1
+        assert results[0] is self.app['students']['A123456']
+
+    def test_search_by_name(self):
+        # We can find a certain name
+        cat = queryUtility(ICatalog, name='students_catalog')
+        results = cat.searchResults(name='Bob Tester')
+        results = [x for x in results] # Turn results generator into list
+        assert len(results) == 1
+        assert results[0] is self.app['students']['A123456']
