Index: /main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/tests/test_browser.py
===================================================================
--- /main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/tests/test_browser.py	(revision 12368)
+++ /main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/tests/test_browser.py	(revision 12369)
@@ -38,5 +38,5 @@
     SkeletonCustomerDocumentProcessor,
     SkeletonContractProcessor)
-from ikobacustom.skeleton.testing import FunctionalLayer
+from ikobacustom.skeleton.testing import FunctionalLayer, samples_dir
 
 SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg')
@@ -253,2 +253,23 @@
         self.assertEqual(
             self.browser.headers['content-type'], 'application/pdf')
+
+class ContractUITests(CustomersFullSetup):
+    # Tests for contract related views and pages
+
+    layer = FunctionalLayer
+
+    def test_view_slips(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        # Officers can open contract slips.
+        # First we add a submitted document and a product.
+        IWorkflowState(self.document).setState('submitted')
+        self.contract.document_object = self.document
+        self.contract.product_object = self.product
+        self.contract.tc_dict = {'en': u'<strong>Hello world</strong>'}
+        self.browser.open(self.customer_path + '/contracts/CON1')
+        self.browser.getLink("Download contract slip").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
+        path = os.path.join(samples_dir(), 'contract_slip.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample contract_slip.pdf written to %s" % path
Index: /main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/testing.py
===================================================================
--- /main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/testing.py	(revision 12368)
+++ /main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/testing.py	(revision 12369)
@@ -18,5 +18,6 @@
 """Testing support for :mod:`waeup.ikoba`.
 """
-import os.path
+import os
+import tempfile
 import ikobacustom.skeleton
 from zope.app.testing.functional import ZCMLLayer
@@ -28,2 +29,11 @@
 FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer',
                             allow_teardown=True)
+
+def samples_dir():
+    # create a directory for sample sheets, if it doesn't exist,
+    # and return its path.
+    tmp_dir = os.path.join(
+        tempfile.gettempdir(), 'ikobacustom.skeleton.pdf-samples')
+    if not os.path.exists(tmp_dir):
+        os.mkdir(tmp_dir)
+    return tmp_dir
