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 12770)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12772)
@@ -50,4 +50,6 @@
 from waeup.ikoba.products.productoptions import ProductOption
 from waeup.ikoba.customers.interfaces import CurrencyMismatch
+from waeup.ikoba.payments.payment import Payment
+from waeup.ikoba.payments.interfaces import IPayer, IPayable, STATE_PAID
 
 PH_LEN = 15911  # Length of placeholder file
@@ -1291,4 +1293,12 @@
         'Select payment method (final submission)')
 
+    def setup_payment(self):
+        payer = IPayer(self.customer)
+        payable = IPayable(self.contract)
+        self.payment = Payment(payer, payable)
+        self.payment.gateway_service = 'demo_creditcard'
+        self.payment.state = STATE_PAID
+        self.app['payments'][self.payment.payment_id] = self.payment
+
     def add_product_option(self, contract):
         prodoption = ProductOption()
@@ -1565,4 +1575,22 @@
         print "Sample contract_slip.pdf written to %s" % path
 
+    def test_view_receipt(self):
+        self.add_product_option(self.contract)
+        self.setup_payment()
+        IWorkflowState(self.document).setState(SUBMITTED)
+        self.contract.document_object = self.document
+        self.contract.product_object = self.product
+        self.contract.title = u'Contract Title'
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        # Officers can open the receipt
+        self.browser.open(self.customer_path + '/contracts/CON1')
+        self.browser.getLink("Download payment receipt").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_payment_receipt.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample contract_payment_receipt.pdf written to %s" % path
+
     def test_contract_approval(self):
         # This is not a UI test. It's just a functional test.
