Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_authentication.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_authentication.py	(revision 5816)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_authentication.py	(revision 5817)
@@ -23,14 +23,11 @@
 import unittest
 from zope.component import provideAdapter
-from zope.component.hooks import setSite
+from zope.component.hooks import setSite, clearSite
 from zope.interface import verify
 from zope.pluggableauth.interfaces import  IAuthenticatedPrincipalFactory
 from zope.publisher.browser import TestRequest
 from zope.publisher.interfaces import IRequest
-from zope.session.session import RAMSessionDataContainer
 from zope.session.interfaces import ISession
 from zope.site import LocalSiteManager
-from zope.site.folder import Folder
-from zope.site.testing import siteSetUp, siteTearDown
 from zope.testing import cleanup
 from waeup.sirp.applicants.authentication import (
@@ -38,6 +35,4 @@
     ApplicantCredentials, AuthenticatedApplicantPrincipalFactory,
     ApplicantPrincipalInfo, ApplicantPrincipal)
-from waeup.sirp.applicants.interfaces import(
-    IJAMBApplicantSessionCredentials,)
 
 class FakeBatch(dict):
@@ -60,14 +55,18 @@
     def __init__(self):
         super(FakeSite, self).__init__()
-        self['applications'] = {
-            'APP-12345': FakeApplication('APP-12345'),
-            'APP-54321': FakeApplication('APP-54321'),
-            'APP-22222': FakeApplication('APP-OTHER'),
-            'APP-44444': FakeApplication(),
-            'APP-55555': FakeApplication('APP-OTHER'),
-            'JAMB1': FakeApplication(),
-            'JAMB2': FakeApplication('APP-12345'),
-            'JAMB3': FakeApplication('APP-54321'),
-            'JAMB4': FakeApplication('APP-44444'),
+        self['applicants'] = {
+            'APP': {
+                'APP-12345': FakeApplication('APP-12345'),
+                'APP-54321': FakeApplication('APP-54321'),
+                'APP-22222': FakeApplication('APP-OTHER'),
+                'APP-44444': FakeApplication(),
+                'APP-55555': FakeApplication('APP-OTHER'),
+                },
+            'JAMB': {
+                'JAMB1': FakeApplication(),
+                'JAMB2': FakeApplication('APP-12345'),
+                'JAMB3': FakeApplication('APP-54321'),
+                'JAMB4': FakeApplication('APP-44444'),
+                },
             }
         self['accesscodes'] = {
@@ -86,8 +85,5 @@
 
     def setUp(self):
-        self.root = Folder()
-        siteSetUp(self.root)
-        self.app = FakeSite() #grok.Application()
-        self.root['app'] = self.app
+        self.app = FakeSite()
         self.app.setSiteManager(LocalSiteManager(self.app))
         self.plugin = ApplicantsAuthenticatorPlugin()
@@ -96,5 +92,5 @@
 
     def tearDown(self):
-        siteTearDown()
+        clearSite()
         return
 
@@ -108,16 +104,8 @@
 
         result = self.plugin.authenticateCredentials(
-            dict(jambregno=None, foo='blah'))
-        assert result is None
-
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode=None, jambregno=None))
-        assert result is None
-
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode='Nonsense', jambregno='Nonsense'))
-        assert result is None
-
-        # The nine possible cases, where formal correct authentication
+            dict(accesscode='Nonsense',))
+        assert result is None
+
+        # Possible cases, where formal correct authentication
         # data is not valid:
         result = self.plugin.authenticateCredentials(
@@ -136,25 +124,4 @@
             dict(accesscode='APP-55555'))
         assert result is None
-        
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode='APP-12345', jambregno='JAMB-NOT-EXISTENT'))
-        assert result is None
-        
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode='APP-12345', jambregno='JAMB3'))
-        assert result is None
-        
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode='APP-54321', jambregno='JAMB-NOT-EXISTENT'))
-        assert result is None
-        
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode='APP-54321', jambregno='JAMB1'))
-        assert result is None
-
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode='APP-54321', jambregno='JAMB2'))
-        assert result is None
-        
         return
 
@@ -174,15 +141,4 @@
         result = self.plugin.authenticateCredentials(
             dict(accesscode='APP-54321'))
-        assert result is not None
-
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode='APP-12345', jambregno='JAMB1'))
-
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode='APP-12345', jambregno='JAMB2'))
-        assert result is not None
-
-        result = self.plugin.authenticateCredentials(
-            dict(accesscode='APP-54321', jambregno='JAMB3'))
         assert result is not None
 
@@ -245,9 +201,8 @@
                 'form.ac_series': '1',
                 'form.ac_number': '1234567890',
-                'form.jamb_reg_no': 'JAMB_NUMBER',
+                #'form.jamb_reg_no': 'JAMB_NUMBER',
                 })
         result = self.plugin.extractCredentials(request)
-        self.assertEqual(result, {'jambregno': 'JAMB_NUMBER',
-                                  'accesscode': 'APP-1-1234567890'})
+        self.assertEqual(result, {'accesscode': 'APP-1-1234567890'})
         return
 
