Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6766)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6767)
@@ -713,4 +713,4 @@
         IWorkflowInfo(self.context).fireTransition('start_clearance')
         self.flash('Clearance process is started.')
-        self.redirect(self.url(self.context))
-        return
+        self.redirect(self.url(self.context,'cedit'))
+        return
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 6766)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 6767)
@@ -34,5 +34,5 @@
     """
     grok.implements(IStudent, IStudentNavigation,
-        IStudentPersonalEdit)
+        IStudentPersonalEdit, IStudentClearanceEdit)
     grok.provides(IStudent)
 
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 6766)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6767)
@@ -30,4 +30,5 @@
 from zope.security.interfaces import Unauthorized
 from zope.testbrowser.testing import Browser
+from hurry.workflow.interfaces import IWorkflowInfo
 from waeup.sirp.testing import FunctionalLayer, FunctionalTestCase
 from waeup.sirp.app import University
@@ -94,13 +95,22 @@
         self.history_student_path = self.student_path + '/history'
 
-        # Create 5 access codes with prefix'PWD' and cost 9.99 each
+        # Create 5 access codes with prefix'PWD'
         pin_container = self.app['accesscodes']
         pin_container.createBatch(
             datetime.now(), 'some_userid', 'PWD', 9.99, 5)
         pins = pin_container[pin_container.keys()[0]].values()
-        self.pins = [x.representation for x in pins]
-        self.existing_pin = self.pins[0]
-        parts = self.existing_pin.split('-')[1:]
-        self.existing_series, self.existing_number = parts
+        self.pwdpins = [x.representation for x in pins]
+        self.existing_pwdpin = self.pwdpins[0]
+        parts = self.existing_pwdpin.split('-')[1:]
+        self.existing_pwdseries, self.existing_pwdnumber = parts
+        # Create 5 access codes with prefix 'CLR'
+        pin_container.createBatch(
+            datetime.now(), 'some_userid', 'CLR', 9.99, 5)
+        pins = pin_container[pin_container.keys()[0]].values()
+        self.clrpins = [x.representation for x in pins]
+        self.existing_clrpin = self.clrpins[0]
+        self.existing_clrpin
+        parts = self.existing_clrpin.split('-')[1:]
+        self.existing_clrseries, self.existing_clrnumber = parts
 
         # Populate university
@@ -310,7 +320,6 @@
         return
 
-    def test_student_access(self):
-        # Students can access their own objects
-        # and can perform actions
+    def test_student_change_password(self):
+        # Students can change the password
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.test_student_id
@@ -350,5 +359,4 @@
     def test_setpassword(self):
         # Set password for first-time access
-        # Add student with subobjects (done by addStudent)
         student = Student()
         student.reg_number = u'123456'
@@ -358,6 +366,6 @@
         student_path = 'http://localhost/app/students/%s' % test_student_id
         self.browser.open(setpassword_path)
-        self.browser.getControl(name="ac_series").value = self.existing_series
-        self.browser.getControl(name="ac_number").value = self.existing_number
+        self.browser.getControl(name="ac_series").value = self.existing_pwdseries
+        self.browser.getControl(name="ac_number").value = self.existing_pwdnumber
         self.browser.getControl(name="reg_number").value = '123456'
         self.browser.getControl("Show").click()
@@ -368,7 +376,43 @@
         self.browser.getControl(name="form.login").value = test_student_id
         self.browser.getControl(
-            name="form.password").value = self.existing_number
+            name="form.password").value = self.existing_pwdnumber
         self.browser.getControl("Login").click()
         self.assertEqual(self.browser.url, student_path)
         self.assertTrue('You logged in' in self.browser.contents)
         return
+
+    def test_student_access(self):
+        # Students can access their own objects
+        # and can perform actions
+        student = self.app['students'][self.test_student_id]
+        IWorkflowInfo(student).fireTransition('admit')
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.test_student_id
+        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl("Login").click()
+        # Student can view the clearance data
+        self.browser.getLink("Clearance Data").click()
+        # Student can't open clearance edit form before starting clearance
+        self.browser.open(self.student_path + '/cedit')
+        self.assertMatches('...The requested form is locked...',
+                           self.browser.contents)
+        self.browser.getLink("Clearance Data").click()
+        self.browser.getLink("Start clearance").click()
+        self.browser.getControl(name="ac_series").value = self.existing_clrseries
+        self.browser.getControl(name="ac_number").value = self.existing_clrnumber
+        self.browser.getControl("Start").click()
+        self.assertMatches('...Clearance process is started...',
+                           self.browser.contents)
+        self.browser.getControl(name="form.date_of_birth").value = '09/10/1961'
+        self.browser.getControl("Save", index=0).click()
+        # Student can view the clearance data
+        self.browser.getLink("Clearance Data").click()
+        # and go back to the edit form
+        self.browser.getLink("Edit").click()
+        self.browser.getControl("Save and request clearance").click()
+        self.assertMatches('...Clearance has been requested...',
+                           self.browser.contents)
+        # Student can't reopen clearance form after requesting clearance
+        self.browser.open(self.student_path + '/cedit')
+        self.assertMatches('...The requested form is locked...',
+                           self.browser.contents)
