Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py	(revision 9436)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py	(revision 9526)
@@ -95,5 +95,5 @@
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         self.browser.open(self.payments_path)
-        self.browser.getControl("Add online payment ticket").click()
+        self.browser.getLink("Add current session payment ticket").click()
         self.browser.getControl("Create ticket").click()
         self.assertMatches('...Amount could not be determined...',
@@ -166,4 +166,11 @@
         self.browser.getControl(name="form.p_category").value = ['schoolfee']
         self.browser.getControl("Create ticket").click()
+        # Uups, we forgot to add a session configuration for next session
+        self.assertTrue('Session configuration object is not available.'
+            in self.browser.contents)
+        configuration = createObject('waeup.SessionConfiguration')
+        configuration.academic_session = 2005
+        self.app['configuration'].addSessionConfiguration(configuration)
+        self.browser.getControl("Create ticket").click()
         self.assertMatches('...ticket created...',
                            self.browser.contents)
@@ -176,12 +183,17 @@
                            self.browser.contents)
 
-        # If the session configuration doesn't exist an error message will
-        # be shown. No other requirement is being checked.
-        del self.app['configuration']['2004']
-        self.browser.open(self.payments_path)
-        self.browser.getControl("Add online payment ticket").click()
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...Session configuration object is not...',
-                           self.browser.contents)
+    def test_student_payments(self):
+        # Login
+        IWorkflowState(self.student).setState('returning')
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.student_id
+        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl("Login").click()
+        self.browser.open(self.student_path + '/payments')
+        self.assertTrue(
+          'Add current session payment ticket' in self.browser.contents)
+        self.assertFalse(
+          'Add previous session payment ticket' in self.browser.contents)
+        return
 
     def test_get_returning_data(self):
@@ -220,4 +232,9 @@
 
         IWorkflowState(self.student).setState('returning')
+        error, payment = utils.setPaymentDetails('schoolfee',self.student)
+        self.assertEqual('Session configuration object is not available.', error)
+        configuration = createObject('waeup.SessionConfiguration')
+        configuration.academic_session = 2005
+        self.app['configuration'].addSessionConfiguration(configuration)
         error, payment = utils.setPaymentDetails('schoolfee',self.student)
         self.assertEqual(payment.p_level, 200)
