Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py	(revision 9115)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py	(revision 9116)
@@ -21,4 +21,5 @@
 import os
 import grok
+from datetime import datetime
 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
 from zope.event import notify
@@ -28,4 +29,6 @@
 from waeup.kofa.interfaces import IExtFileStore, IFileStoreNameChooser
 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
+
+session = datetime.now().year - 2
 
 class ApplicantCopierFunctionalTests(ApplicantsFullSetup):
@@ -118,7 +121,7 @@
         # Has the student studycourse the correct attributes?
         self.assertEqual(student['studycourse'].certificate.code, 'CERT1')
-        self.assertEqual(student['studycourse'].entry_session, 2009)
+        self.assertEqual(student['studycourse'].entry_session, session)
         self.assertEqual(student['studycourse'].entry_mode, 'ug_ft')
-        self.assertEqual(student['studycourse'].current_session, 2009)
+        self.assertEqual(student['studycourse'].current_session, session)
         self.assertEqual(student['studycourse'].current_level, 100)
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py	(revision 9115)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py	(revision 9116)
@@ -23,4 +23,5 @@
 import tempfile
 import grok
+from datetime import datetime
 from StringIO import StringIO
 from datetime import datetime, date, timedelta
@@ -46,4 +47,9 @@
 PH_LEN = 2059  # Length of placeholder file
 
+session_1 = datetime.now().year - 2
+container_name_1 = u'app%s' % session_1
+session_2 = datetime.now().year - 1
+container_name_2 = u'app%s' % session_2
+
 class ApplicantsFullSetup(FunctionalTestCase):
     # A test case that only contains a setup and teardown
@@ -80,13 +86,13 @@
         self.manage_root_path = self.root_path + '/@@manage'
         self.add_container_path = self.root_path + '/@@add'
-        self.container_path = 'http://localhost/app/applicants/app2009'
+        self.container_path = 'http://localhost/app/applicants/%s' % container_name_1
         self.manage_container_path = self.container_path + '/@@manage'
 
         # Add an applicants container
         applicantscontainer = ApplicantsContainer()
-        applicantscontainer.code = u'app2009'
+        applicantscontainer.code = container_name_1
         applicantscontainer.prefix = 'app'
-        applicantscontainer.year = 2009
-        applicantscontainer.title = u'This is the app2009 container'
+        applicantscontainer.year = session_1
+        applicantscontainer.title = u'This is the %s container' % container_name_1
         applicantscontainer.application_category = 'basic'
         applicantscontainer.mode = 'create'
@@ -95,6 +101,6 @@
         applicantscontainer.startdate = datetime.now(pytz.utc) - delta
         applicantscontainer.enddate = datetime.now(pytz.utc) + delta
-        self.app['applicants']['app2009'] = applicantscontainer
-        self.applicantscontainer = self.app['applicants']['app2009']
+        self.app['applicants'][container_name_1] = applicantscontainer
+        self.applicantscontainer = self.app['applicants'][container_name_1]
 
         # Populate university
@@ -135,14 +141,14 @@
         self.applicant.reg_number = u'1234'
         self.applicant.course1 = certificate
-        app['applicants']['app2009'].addApplicant(self.applicant)
+        app['applicants'][container_name_1].addApplicant(self.applicant)
         IUserAccount(
-            self.app['applicants']['app2009'][
+            self.app['applicants'][container_name_1][
             self.applicant.application_number]).setPassword('apwd')
         self.manage_path = 'http://localhost/app/applicants/%s/%s/%s' % (
-            'app2009', self.applicant.application_number, 'manage')
+            container_name_1, self.applicant.application_number, 'manage')
         self.edit_path = 'http://localhost/app/applicants/%s/%s/%s' % (
-            'app2009', self.applicant.application_number, 'edit')
+            container_name_1, self.applicant.application_number, 'edit')
         self.view_path = 'http://localhost/app/applicants/%s/%s' % (
-            'app2009', self.applicant.application_number)
+            container_name_1, self.applicant.application_number)
 
     def login(self):
@@ -303,5 +309,5 @@
             'There were errors' in self.browser.contents)
         self.browser.getControl(name="form.prefix").value = ['app']
-        self.browser.getControl(name="form.year").value = ['2010']
+        self.browser.getControl(name="form.year").value = [str(session_2)]
         self.browser.getControl(name="form.mode").value = ['create']
         self.browser.getControl(
@@ -317,5 +323,5 @@
         self.browser.open(self.add_container_path)
         self.browser.getControl(name="form.prefix").value = ['app']
-        self.browser.getControl(name="form.year").value = ['2010']
+        self.browser.getControl(name="form.year").value = [str(session_2)]
         self.browser.getControl(name="form.mode").value = ['create']
         self.browser.getControl(
@@ -326,10 +332,10 @@
         self.browser.open(self.manage_root_path)
         ctrl = self.browser.getControl(name='val_id')
-        ctrl.getControl(value='app2010').selected = True
+        ctrl.getControl(value=container_name_2).selected = True
         self.browser.getControl("Remove selected", index=0).click()
         self.assertTrue('Successfully removed:' in self.browser.contents)
         self.browser.open(self.add_container_path)
         self.browser.getControl(name="form.prefix").value = ['app']
-        self.browser.getControl(name="form.year").value = ['2010']
+        self.browser.getControl(name="form.year").value = [str(session_2)]
         self.browser.getControl(name="form.mode").value = ['create']
         #self.browser.getControl(name="form.ac_prefix").value = ['APP']
@@ -337,7 +343,7 @@
             name="form.application_category").value = ['basic']
         self.browser.getControl("Add applicants container").click()
-        del self.app['applicants']['app2010']
+        del self.app['applicants'][container_name_2]
         ctrl = self.browser.getControl(name='val_id')
-        ctrl.getControl(value='app2010').selected = True
+        ctrl.getControl(value=container_name_2).selected = True
         self.browser.getControl("Remove selected", index=0).click()
         self.assertMatches('...Could not delete...', self.browser.contents)
@@ -711,5 +717,5 @@
             in self.browser.contents)
         configuration = SessionConfiguration()
-        configuration.academic_session = 2009
+        configuration.academic_session = session_1
         configuration.application_fee = 200.0
         self.app['configuration'].addSessionConfiguration(configuration)
@@ -739,6 +745,6 @@
         payment_id = self.applicant.keys()[0]
         payment = self.applicant[payment_id]
-        self.assertEqual(payment.p_item,'This is the app2009 container')
-        self.assertEqual(payment.p_session,2009)
+        self.assertEqual(payment.p_item,'This is the %s container' % container_name_1)
+        self.assertEqual(payment.p_session, session_1)
         self.assertEqual(payment.p_category,'application')
         self.assertEqual(payment.amount_auth,200.0)
@@ -989,5 +995,5 @@
             in self.browser.contents)
         #IUserAccount(
-        #    self.app['applicants']['app2009'][
+        #    self.app['applicants'][container_name_1][
         #    self.applicant.application_number]).context.password = None
         # Even without unsetting the password we can re-register if state
