Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12093)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12094)
@@ -1073,4 +1073,5 @@
         self.browser.getLink("a102").click()
         self.browser.getLink("Manage").click()
+        self.browser.getControl(name="form.product").value = ['SAM']
         self.browser.getControl(name="form.title").value = 'My second app'
         self.browser.getControl("Save").click()
@@ -1144,7 +1145,15 @@
         # ... but NOTSAM not.
         self.assertFalse('<option value="LIC">' in self.browser.contents)
+        # So far last_product_id is None.
+        self.assertTrue(self.customer['applications']['a102'].last_product_id is None)
         self.browser.getControl(name="form.product").value = ['SAM']
         self.browser.getControl("Save").click()
+        # After saving the form, last_product_id is set.
+        self.assertEqual(self.customer['applications']['a102'].last_product_id, 'SAM')
+        self.assertTrue('Form has been saved.' in self.browser.contents)
+        # Saving the form again does not unset last_product_id
         self.assertEqual(application.title, 'My second app')
+        self.browser.getControl("Save").click()
+        self.assertEqual(self.customer['applications']['a102'].last_product_id, 'SAM')
         self.assertTrue('Form has been saved.' in self.browser.contents)
         self.browser.getLink("View").click()
@@ -1153,5 +1162,5 @@
         self.browser.getLink("Edit").click()
         self.browser.getControl(name="form.title").value = 'My third app'
-        self.browser.getControl("Final Submit").click()
+        self.browser.getControl("Apply now").click()
         self.assertEqual(application.title, 'My third app')
         self.assertEqual(application.state, 'submitted')
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_catalog.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_catalog.py	(revision 12093)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_catalog.py	(revision 12094)
@@ -1,3 +1,3 @@
-## $Id: test_catalog.py 10552 2013-08-28 14:33:33Z henrik $
+## $Id$
 ##
 ## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann
@@ -26,4 +26,6 @@
 from waeup.ikoba.testing import FunctionalLayer, FunctionalTestCase
 from waeup.ikoba.customers.customer import Customer
+from waeup.ikoba.customers.applications import SampleApplication
+
 
 class CatalogTestSetup(FunctionalTestCase):
@@ -54,6 +56,27 @@
         self.customer_id = customer.customer_id
         self.customer = self.app['customers'][self.customer_id]
-        # Update the customers_catalog
-        notify(grok.ObjectModifiedEvent(self.customer))
+
+        product = createObject('waeup.Product')
+        product.product_id = u'SAM'
+        product.title = u'Our Samle Product'
+        product.application_category = u'sample'
+        self.app['products'].addProduct(product)
+        self.product_id = product.product_id
+        self.product = self.app['products'][self.product_id]
+
+        application = createObject('waeup.SampleApplication')
+        application.title = u'My Samle Application'
+        application.product = product
+        application.last_product_id = product.product_id
+        self.customer['applications'].addApplication(application)
+        self.application_id = application.application_id
+        self.application = self.customer['applications'][self.application_id]
+
+        document = createObject('waeup.CustomerSampleDocument')
+        document.title = u'My Samle Document'
+        self.customer['documents'].addDocument(document)
+        self.document_id = document.document_id
+        self.document = self.customer['documents'][self.document_id]
+
         return
 
@@ -63,5 +86,6 @@
         return
 
-class CustomerCatalogTests(CatalogTestSetup):
+
+class CustomersCatalogTests(CatalogTestSetup):
 
     layer = FunctionalLayer
@@ -88,2 +112,57 @@
         assert len(results) == 1
         assert results[0] is self.app['customers'][self.customer_id]
+
+
+class DocumentsCatalogTests(CatalogTestSetup):
+
+    layer = FunctionalLayer
+
+    def test_get_catalog(self):
+        # We can get an customers catalog if we wish
+        cat = queryUtility(ICatalog, name='documents_catalog')
+        assert cat is not None
+
+    def test_search_by_id(self):
+        # We can find a certain application id
+        cat = queryUtility(ICatalog, name='documents_catalog')
+        results = cat.searchResults(document_id=(self.document_id,
+                                                self.document_id))
+        results = [x for x in results] # Turn results generator into list
+        assert len(results) == 1
+        assert results[0] is self.customer['documents'][self.document_id]
+
+
+class ApplicationsCatalogTests(CatalogTestSetup):
+
+    layer = FunctionalLayer
+
+    def test_get_catalog(self):
+        # We can get an customers catalog if we wish
+        cat = queryUtility(ICatalog, name='applications_catalog')
+        assert cat is not None
+
+    def test_search_by_id(self):
+        # We can find a certain application id
+        cat = queryUtility(ICatalog, name='applications_catalog')
+        results = cat.searchResults(application_id=(self.application_id,
+                                                self.application_id))
+        results = [x for x in results] # Turn results generator into list
+        assert len(results) == 1
+        assert results[0] is self.customer['applications'][self.application_id]
+
+    def test_search_by_category(self):
+        # We can find a certain name
+        cat = queryUtility(ICatalog, name='applications_catalog')
+        results = cat.searchResults(application_category=('sample', 'sample'))
+        results = [x for x in results] # Turn results generator into list
+        assert len(results) == 1
+        assert results[0] is self.customer['applications'][self.application_id]
+
+    def test_search_by_last_product_id(self):
+        # We can find a certain name
+        cat = queryUtility(ICatalog, name='applications_catalog')
+        results = cat.searchResults(last_product_id=('SAM', 'SAM'))
+        results = [x for x in results] # Turn results generator into list
+        assert len(results) == 1
+        assert results[0] is self.customer['applications'][self.application_id]
+        assert results[0].product is self.product
