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 7636)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_catalog.py	(revision 7637)
@@ -169,5 +169,5 @@
 
     def test_get_catalog(self):
-        # We can get an students catalog if we wish
+        # We can get a students catalog if we wish
         cat = queryUtility(ICatalog, name='payments_catalog')
         assert cat is not None
@@ -217,2 +217,29 @@
         assert results[0] is self.app['students'][self.student_id][
             'payments']['p1234567890']
+
+    def test_reindex_payments(self):
+        cat = queryUtility(ICatalog, name='payments_catalog')
+        results = cat.searchResults(p_state=('failed','failed'))
+        assert len(results) == 0
+        results = cat.searchResults(p_state=('paid','paid'))
+        assert len(results) == 1
+        results = [x for x in results] # Turn results generator into list
+        assert results[0] is self.app['students'][self.student_id][
+            'payments']['p1234567890']
+        results[0].p_state = 'failed'
+        # Since we did not fire an ObjectModifiedEvent the catalog remained
+        # unchanged
+        results = cat.searchResults(p_state=('paid','paid'))
+        assert len(results) == 1
+        # Reindexing the catalog will lead to correct search results
+        #reindexPayments()
+        cat.clear() # The test works with and without clearing the catalog
+        cat.updateIndexes()
+        results = cat.searchResults(p_state=('paid','paid'))
+        assert len(results) == 0
+        results = cat.searchResults(p_state=('failed','failed'))
+        assert len(results) == 1
+        results = [x for x in results] # Turn results generator into list
+        assert len(results) == 1
+        assert results[0] is self.app['students'][self.student_id][
+            'payments']['p1234567890']
