Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 8411)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 8420)
@@ -176,4 +176,5 @@
         configuration.academic_session = 2004
         configuration.clearance_fee = 3456.0
+        configuration.booking_fee = 123.4
         self.app['configuration'].addSessionConfiguration(configuration)
 
@@ -1288,8 +1289,8 @@
                            self.browser.contents)
 
-        # Managers can open the callback view which simulates a valid callback
+        # Managers can approve the payment
         self.assertEqual(len(self.app['accesscodes']['SFE-0']),0)
         self.browser.open(payment_url)
-        self.browser.getLink("Request callback").click()
+        self.browser.getLink("Approve payment").click()
         self.assertMatches('...Valid callback received...',
                           self.browser.contents)
@@ -1299,6 +1300,6 @@
             self.app['accesscodes']['SFE-0'].values()[0].cost,40000.0)
 
-        # Callback can't be applied twice
-        self.browser.open(payment_url + '/simulate_callback')
+        # Payments can't be approved twice
+        self.browser.open(payment_url + '/approve')
         self.assertMatches('...This ticket has already been paid...',
                           self.browser.contents)
@@ -1337,10 +1338,10 @@
                            self.browser.contents)
 
-        # Managers can open the callback view which simulates a valid callback
+        # Managers can approve the payment
         self.assertEqual(len(self.app['accesscodes']['CLR-0']),0)
         ctrl = self.browser.getControl(name='val_id')
         value = ctrl.options[1] # The clearance payment is the second in the table
         self.browser.getLink(value).click()
-        self.browser.open(self.browser.url + '/simulate_callback')
+        self.browser.open(self.browser.url + '/approve')
         self.assertMatches('...Valid callback received...',
                           self.browser.contents)
@@ -1372,5 +1373,5 @@
                            self.browser.contents)
 
-        # Students can open the callback view which simulates a valid callback
+        # Students can't approve the payment
         self.assertEqual(len(self.app['accesscodes']['CLR-0']),0)
         ctrl = self.browser.getControl(name='val_id')
@@ -1378,5 +1379,8 @@
         self.browser.getLink(value).click()
         payment_url = self.browser.url
-        self.browser.open(payment_url + '/simulate_callback')
+        self.assertRaises(
+            Unauthorized, self.browser.open, payment_url + '/approve')
+        # In the base package they can 'use' a fake approval view
+        self.browser.open(payment_url + '/fake_approve')
         self.assertMatches('...Valid callback received...',
                           self.browser.contents)
@@ -1385,5 +1389,14 @@
           <span>Paid</span>
         </td>...'''
+        expected = '''...
+        <td>
+          <span>Paid</span>
+        </td>...'''
         self.assertMatches(expected,self.browser.contents)
+        payment_id = self.student['payments'].keys()[0]
+        payment = self.student['payments'][payment_id]
+        self.assertEqual(payment.p_state, 'paid')
+        self.assertEqual(payment.r_amount_approved, 3456.0)
+        self.assertEqual(payment.r_code, 'AP')
         # The new CLR-0 pin has been created
         self.assertEqual(len(self.app['accesscodes']['CLR-0']),1)
@@ -1441,7 +1454,7 @@
         self.assertEqual(self.student['payments'][value].p_level, 200)
 
-        # Students can open the callback view which simulates a valid callback
+        # We simulate the approval
         self.assertEqual(len(self.app['accesscodes']['SFE-0']),0)
-        self.browser.open(self.browser.url + '/simulate_callback')
+        self.browser.open(self.browser.url + '/fake_approve')
         self.assertMatches('...Valid callback received...',
                           self.browser.contents)
@@ -1453,5 +1466,5 @@
             LookupError, self.browser.getControl, name='val_id')
         self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['gown']
+        self.browser.getControl(name="form.p_category").value = ['bed_allocation']
         self.browser.getControl("Create ticket").click()
         self.browser.open(self.payments_path)
@@ -1495,5 +1508,5 @@
         value = ctrl.options[0]
         self.browser.getLink(value).click()
-        self.browser.open(self.browser.url + '/simulate_callback')
+        self.browser.open(self.browser.url + '/approve')
         # The new HOS-0 pin has been created
         self.assertEqual(len(self.app['accesscodes']['HOS-0']),1)
@@ -1608,5 +1621,5 @@
         return
 
-    def test_student_accommodation(self):
+    def xx_test_student_accommodation(self):
         # Login
         self.browser.open(self.login_path)
@@ -1624,5 +1637,5 @@
         value = ctrl.options[0]
         self.browser.getLink(value).click()
-        self.browser.open(self.browser.url + '/simulate_callback')
+        self.browser.open(self.browser.url + '/fake_approve')
         # The new HOS-0 pin has been created
         self.assertEqual(len(self.app['accesscodes']['HOS-0']),1)
