Index: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6912)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6914)
@@ -337,10 +337,15 @@
         self.browser.getControl("Add study level").click()
         self.assertMatches('...<span>100</span>...', self.browser.contents)
+        self.browser.getControl("Add study level").click()
+        self.assertMatches('...This level exists...', self.browser.contents)
+        self.browser.getControl("Remove selected").click()
+        self.assertMatches('...No study level selected...', self.browser.contents)
         self.browser.getControl(name="val_id").value = ['100']
         self.browser.getControl("Remove selected").click()
         self.assertMatches('...Successfully removed...', self.browser.contents)
-        # Add again level again
+        # Add level again
         self.browser.getControl(name="addlevel").value = ['100']
         self.browser.getControl("Add study level").click()
+        self.browser.getControl(name="addlevel").value = ['100']
 
         # Managers can view and manage course lists
@@ -350,4 +355,6 @@
         self.browser.getControl(name="form.level_session").value = ['2002']
         self.browser.getControl("Save").click()
+        self.browser.getControl("Remove selected").click()
+        self.assertMatches('...No ticket selected...', self.browser.contents)
         ctrl = self.browser.getControl(name='val_id')
         ctrl.getControl(value='COURSE1').selected = True
@@ -358,4 +365,9 @@
         self.browser.getControl("Add course ticket").click()
         self.assertTrue('Successfully added' in self.browser.contents)
+        self.browser.getControl("Add course ticket").click()
+        self.browser.getControl(name="form.course").value = ['COURSE1']
+        self.browser.getControl("Add course ticket").click()
+        self.assertTrue('The ticket exists' in self.browser.contents)
+        self.browser.getControl("Cancel").click()
         self.browser.getLink("COURSE1").click()
         self.browser.getLink("Manage").click()
@@ -564,4 +576,9 @@
         self.browser.getLink("Clearance Data").click()
         self.browser.getLink("Start clearance").click()
+        self.browser.getControl(name="ac_series").value = '3'
+        self.browser.getControl(name="ac_number").value = '4444444'
+        self.browser.getControl("Start clearance now").click()
+        self.assertMatches('...Access code is invalid...',
+                           self.browser.contents)
         self.browser.getControl(name="ac_series").value = self.existing_clrseries
         self.browser.getControl(name="ac_number").value = self.existing_clrnumber
@@ -585,7 +602,12 @@
         self.assertMatches('...The requested form is locked...',
                            self.browser.contents)
+        # Student can't add study level if not in state 'school fee paid'
+        self.browser.open(self.student_path + '/studycourse/add')
+        self.assertMatches('...The requested form is locked...',
+                           self.browser.contents)
+        # ... and must be transferred first
         IWorkflowInfo(student).fireTransition('clear')
         IWorkflowInfo(student).fireTransition('pay_first_school_fee')
-        # Students can add the current study level
+        # Now students can add the current study level
         self.browser.getLink("Study Course").click()
         self.browser.getLink("Add course list").click()
@@ -613,4 +635,6 @@
         self.assertMatches('...Successfully added COURSE1...',
                            self.browser.contents)
+        self.browser.getControl("Remove selected", index=0).click()
+        self.assertTrue('No ticket selected' in self.browser.contents)
         ctrl = self.browser.getControl(name='val_id')
         ctrl.getControl(value='COURSE1').selected = True
@@ -636,5 +660,8 @@
         self.assertMatches('...Amount Authorized...',
                            self.browser.contents)
-        self.browser.open(self.payments_student_path + '/manage')
+        self.browser.open(self.payments_student_path)
+        self.browser.getLink('Manage').click()
+        self.browser.getControl("Remove selected").click()
+        self.assertMatches('...No payment selected...', self.browser.contents)
         ctrl = self.browser.getControl(name='val_id')
         value = ctrl.options[0]
