Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/sample_student_data.csv
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/sample_student_data.csv	(revision 9036)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/sample_student_data.csv	(revision 9041)
@@ -1,4 +1,4 @@
-firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex
-Aaren,Pieri,1,,100000,aa@aa.ng,1234,m
-Aaren,Finau,2,,100001,aa@aa.ng,1234,m
-Aaren,Berson,3,,100002,aa@aa.ng,1234,m
+firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,nationality
+Aaren,Pieri,1,,100000,aa@aa.ng,1234,m,DE
+Aaren,Finau,2,,100001,aa@aa.ng,1234,m,NG
+Aaren,Berson,3,,100002,aa@aa.ng,1234,m,FR
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py	(revision 9036)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py	(revision 9041)
@@ -20,5 +20,5 @@
 import tempfile
 from StringIO import StringIO
-from hurry.workflow.interfaces import IWorkflowState
+from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo
 from zope.component.hooks import setSite, clearSite
 from zope.component import getUtility, createObject
@@ -105,4 +105,8 @@
     layer = FunctionalLayer
 
+    def setUp(self):
+        super(StudentUITests, self).setUp()
+        self.student.nationality = u'DE'
+
     def test_classes(self):
         # Let's see if objects created in the customized
@@ -184,5 +188,4 @@
         # Students can edit clearance data
         IWorkflowState(self.student).setState('cleared')
-        self.student.clearance_locked = False
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.student_id
@@ -203,6 +206,45 @@
         self.browser.open(self.student_path + '/change_portrait')
         self.assertTrue('The requested form is locked' in self.browser.contents)
-        # Student can view and edit clearance data
+
+        # Student can view and edit clearance data if clearance has started
+        IWorkflowInfo(self.student).fireTransition('start_clearance')
         self.browser.getLink("Clearance Data").click()
         self.browser.getLink("Edit").click()
         self.assertTrue('Save' in self.browser.contents)
+
+        # Clearance can only be requested if all required documents
+        # have been uploaded.
+        self.browser.getControl("Save and request clearance").click()
+        self.assertTrue('No birth certificate uploaded' in self.browser.contents)
+        birth_certificate = 'My birth certificate'
+        file_id = IFileStoreNameChooser(self.student).chooseName(
+            attr="birth_certificate.jpg")
+        file_store.createFile(file_id, StringIO(birth_certificate))
+        self.browser.open(self.edit_clearance_path)
+        self.browser.getControl("Save and request clearance").click()
+
+        self.assertTrue('No referee letter uploaded' in self.browser.contents)
+        ref_let = 'My ref let'
+        file_id = IFileStoreNameChooser(self.student).chooseName(
+            attr="ref_let.jpg")
+        file_store.createFile(file_id, StringIO(ref_let))
+        self.browser.open(self.edit_clearance_path)
+        self.browser.getControl("Save and request clearance").click()
+
+        self.assertTrue('No acceptance letter uploaded' in self.browser.contents)
+        acc_let = 'My acc let'
+        file_id = IFileStoreNameChooser(self.student).chooseName(
+            attr="acc_let.jpg")
+        file_store.createFile(file_id, StringIO(acc_let))
+        self.browser.open(self.edit_clearance_path)
+        self.browser.getControl("Save and request clearance").click()
+
+        self.assertTrue('No first sitting result uploaded' in self.browser.contents)
+        fst_sit_scan = 'My first sitting result'
+        file_id = IFileStoreNameChooser(self.student).chooseName(
+            attr="fst_sit_scan.jpg")
+        file_store.createFile(file_id, StringIO(fst_sit_scan))
+        self.browser.open(self.edit_clearance_path)
+        self.browser.getControl("Save and request clearance").click()
+        self.assertTrue('Enter the CLR access code used for starting clearance'
+            in self.browser.contents)
