Index: main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py	(revision 14369)
+++ main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py	(revision 14375)
@@ -588,5 +588,5 @@
 
     def test_late_registration(self):
-        # Login
+        self.app['configuration']['2004'].restitution_fee = 9999.0
         delta = timedelta(days=10)
         self.app['configuration'][
@@ -596,9 +596,15 @@
         # returning students.
         self.student['studycourse'].entry_session = 2003
-        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.payments_path)
+        # Login
+        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()
+        # Make restitution fee payment
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['restitution']
+        self.browser.getControl("Create ticket").click()
+        self.student['payments'].values()[0].approveStudentPayment()
+        # Make late registration fee fee payment
         self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(name="form.p_category").value = ['late_registration']
@@ -619,5 +625,5 @@
         self.browser.getControl("Register course list").click()
         self.assertTrue('Course registration has ended. Please pay' in self.browser.contents)
-        self.student['payments'].values()[0].approve()
+        self.student['payments'].values()[1].approve()
         self.browser.getControl("Register course list").click()
         self.assertTrue('Course list has been registered' in self.browser.contents)
@@ -626,5 +632,5 @@
         # register courses.
         self.student['studycourse'].entry_session = 2004
-        del self.student['payments'][self.student['payments'].keys()[0]]
+        del self.student['payments'][self.student['payments'].keys()[1]]
         IWorkflowState(self.student).setState('school fee paid')
         self.browser.open(self.studycourse_path + '/100/edit')
@@ -932,12 +938,36 @@
         self.assertTrue('Please pay faculty and departmental dues first'
             in self.browser.contents)
-
         configuration_1 = createObject('waeup.SessionConfiguration')
         configuration_1.academic_session = 2016
         configuration_1.fac_dep_fee = 9999.0
         self.app['configuration'].addSessionConfiguration(configuration_1)
-
         self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(name="form.p_category").value = ['fac_dep']
+        self.browser.getControl("Create ticket").click()
+        self.student['payments'].values()[0].approveStudentPayment()
+        self.browser.open(self.studycourse_path + '/100/edit')
+        self.browser.getControl("Register course list").click()
+        self.assertTrue('Course list has been registered'
+            in self.browser.contents)
+        return
+
+    def test_course_registration_forbidden_2(self):
+        IWorkflowState(self.student).setState('school fee paid')
+        self.student['studycourse'].entry_session = 2004
+        self.student['studycourse'].current_session = 2004
+        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.getLink("Study Course").click()
+        self.browser.getLink("Add course list").click()
+        self.browser.getControl("Create course list now").click()
+        self.browser.getLink("Edit course list").click()
+        self.browser.getControl("Register course list").click()
+        self.assertTrue('Please pay restitution fee first'
+            in self.browser.contents)
+        self.app['configuration']['2004'].restitution_fee = 9999.0
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['restitution']
         self.browser.getControl("Create ticket").click()
         self.student['payments'].values()[0].approveStudentPayment()
