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 9255)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9257)
@@ -2063,5 +2063,41 @@
                         'K1000000 - account activated' in logcontent)
 
-    def test_student_transfer(self):
+    def test_student_locked_level_forms(self):
+
+        # Add two study levels, one current and one previous
+        studylevel = createObject(u'waeup.StudentStudyLevel')
+        studylevel.level = 100
+        self.student['studycourse'].addStudentStudyLevel(
+            self.certificate, studylevel)
+        studylevel = createObject(u'waeup.StudentStudyLevel')
+        studylevel.level = 200
+        self.student['studycourse'].addStudentStudyLevel(
+            self.certificate, studylevel)
+        IWorkflowState(self.student).setState('school fee paid')
+        self.student['studycourse'].current_level = 200
+
+        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 + '/studycourse/200/edit')
+        self.assertFalse('The requested form is locked' in self.browser.contents)
+        self.browser.open(self.student_path + '/studycourse/100/edit')
+        self.assertTrue('The requested form is locked' in self.browser.contents)
+
+        self.browser.open(self.student_path + '/studycourse/200/ctadd')
+        self.assertFalse('The requested form is locked' in self.browser.contents)
+        self.browser.open(self.student_path + '/studycourse/100/ctadd')
+        self.assertTrue('The requested form is locked' in self.browser.contents)
+
+        IWorkflowState(self.student).setState('courses registered')
+        self.browser.open(self.student_path + '/studycourse/200/edit')
+        self.assertTrue('The requested form is locked' in self.browser.contents)
+        self.browser.open(self.student_path + '/studycourse/200/ctadd')
+        self.assertTrue('The requested form is locked' in self.browser.contents)
+
+
+    def test_manage_student_transfer(self):
         # Add second certificate
         self.certificate2 = createObject('waeup.Certificate')
@@ -2076,4 +2112,8 @@
         studylevel = createObject(u'waeup.StudentStudyLevel')
         studylevel.level = 200
+        self.student['studycourse'].addStudentStudyLevel(
+            self.certificate, studylevel)
+        studylevel = createObject(u'waeup.StudentStudyLevel')
+        studylevel.level = 999
         self.student['studycourse'].addStudentStudyLevel(
             self.certificate, studylevel)
@@ -2104,5 +2144,5 @@
         # Add study level to new study course
         studylevel = createObject(u'waeup.StudentStudyLevel')
-        studylevel.level = 200
+        studylevel.level = 999
         self.student['studycourse'].addStudentStudyLevel(
             self.certificate, studylevel)
@@ -2125,27 +2165,27 @@
         self.assertTrue('The requested form is locked' in self.browser.contents)
 
-        self.browser.open(self.student_path + '/studycourse/200/manage')
+        self.browser.open(self.student_path + '/studycourse/999/manage')
         self.assertFalse('The requested form is locked' in self.browser.contents)
-        self.browser.open(self.student_path + '/studycourse_1/200/manage')
+        self.browser.open(self.student_path + '/studycourse_1/999/manage')
         self.assertTrue('The requested form is locked' in self.browser.contents)
 
-        self.browser.open(self.student_path + '/studycourse/200/validate_courses')
+        self.browser.open(self.student_path + '/studycourse/999/validate_courses')
         self.assertFalse('The requested form is locked' in self.browser.contents)
-        self.browser.open(self.student_path + '/studycourse_1/200/validate_courses')
+        self.browser.open(self.student_path + '/studycourse_1/999/validate_courses')
         self.assertTrue('The requested form is locked' in self.browser.contents)
 
-        self.browser.open(self.student_path + '/studycourse/200/reject_courses')
+        self.browser.open(self.student_path + '/studycourse/999/reject_courses')
         self.assertFalse('The requested form is locked' in self.browser.contents)
-        self.browser.open(self.student_path + '/studycourse_1/200/reject_courses')
+        self.browser.open(self.student_path + '/studycourse_1/999/reject_courses')
         self.assertTrue('The requested form is locked' in self.browser.contents)
 
-        self.browser.open(self.student_path + '/studycourse/200/add')
+        self.browser.open(self.student_path + '/studycourse/999/add')
         self.assertFalse('The requested form is locked' in self.browser.contents)
-        self.browser.open(self.student_path + '/studycourse_1/200/add')
+        self.browser.open(self.student_path + '/studycourse_1/999/add')
         self.assertTrue('The requested form is locked' in self.browser.contents)
 
-        self.browser.open(self.student_path + '/studycourse/200/edit')
+        self.browser.open(self.student_path + '/studycourse/999/edit')
         self.assertFalse('The requested form is locked' in self.browser.contents)
-        self.browser.open(self.student_path + '/studycourse_1/200/edit')
+        self.browser.open(self.student_path + '/studycourse_1/999/edit')
         self.assertTrue('The requested form is locked' in self.browser.contents)
 
