Index: /main/waeup.futminna/trunk/src/waeup/futminna/applicants/tests/test_browser.py
===================================================================
--- /main/waeup.futminna/trunk/src/waeup/futminna/applicants/tests/test_browser.py	(revision 10215)
+++ /main/waeup.futminna/trunk/src/waeup/futminna/applicants/tests/test_browser.py	(revision 10216)
@@ -21,4 +21,6 @@
 
 import os
+import grok
+from zope.event import notify
 from StringIO import StringIO
 from zope.component import createObject, getUtility
@@ -248,12 +250,45 @@
 
     def test_certificate_source(self):
+        # We add a second 'alternative' certificate
+        certificate = createObject('waeup.Certificate')
+        certificate.code = 'CERT2'
+        certificate.title = 'New Certificate'
+        certificate.application_category = 'basic'
+        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
+            certificate)
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        self.browser.open(self.manage_path)
-        self.assertTrue('value="CERT1">CERT1 - Unnamed Certificate</option>'
-            in self.browser.contents)
+        self.browser.open(self.edit_path)
+        self.assertFalse('course2' in self.browser.contents)
         self.certificate.custom_textline_1 = u'Maths, Physics'
         self.certificate.custom_float_1 = 50.0
-        self.browser.open(self.manage_path)
-        self.assertTrue(
-            'value="CERT1">CERT1 - Unnamed Certificate [Maths, Physics, 50]</option>'
-            in self.browser.contents)
+        certificate.custom_textline_1 = u'German, Physics'
+        certificate.custom_float_1 = 30.0
+        notify(grok.ObjectModifiedEvent(certificate))
+        self.browser.open(self.edit_path)
+        # Score must be set and below the limit
+        # of course1 to see course2 field
+        self.applicant.jamb_score = 20
+        self.browser.open(self.edit_path)
+        self.assertTrue('course2' in self.browser.contents)
+        # But 20 is not enough to select the alternative CERT2
+        self.assertFalse(
+            'value="CERT2">CERT2 - New Certificate'
+            in self.browser.contents)
+        self.applicant.jamb_score = 30
+        self.browser.open(self.edit_path)
+        # 30 is enough
+        self.assertTrue('course2' in self.browser.contents)
+        self.assertTrue(
+            'value="CERT2">CERT2 - New Certificate [German, Physics, 30]</option>'
+            in self.browser.contents)
+
+    def test_low_jamb_score(self):
+        self.login()
+        self.assertFalse('<select id="form.course2" name="form.course2" size="1" >'
+            in self.browser.contents)
+        self.certificate.custom_textline_1 = u'Maths, Physics'
+        self.certificate.custom_float_1 = 50.0
+        self.applicant.jamb_score = 40
+        self.browser.open(self.edit_path)
+        self.assertTrue('<select id="form.course2" name="form.course2" size="1" >'
+            in self.browser.contents)
Index: /main/waeup.futminna/trunk/src/waeup/futminna/applicants/utils.py
===================================================================
--- /main/waeup.futminna/trunk/src/waeup/futminna/applicants/utils.py	(revision 10215)
+++ /main/waeup.futminna/trunk/src/waeup/futminna/applicants/utils.py	(revision 10216)
@@ -37,5 +37,14 @@
         """Filter and sort certificates in AppCatCertificateSource.
         """
-        return sorted(resultset, key=lambda value: value.code)
+        certs = sorted(resultset, key=lambda value: value.code)
+        resultlist = [cert for cert in certs
+            if not None in (context.jamb_score, cert.custom_float_1)
+                and context.jamb_score >= cert.custom_float_1]
+        curr_course = context.course1
+        if curr_course is not None and curr_course not in resultlist:
+            # display also current course even if certificate has been removed
+            # or does not meet requirement
+            resultlist = [curr_course,] + resultlist
+        return resultlist
 
     def getCertTitle(self, context, value):
