Index: main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests/test_browser.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests/test_browser.py	(revision 15313)
+++ main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests/test_browser.py	(revision 16078)
@@ -21,8 +21,12 @@
 """
 import os
+import datetime
+import pytz
 from StringIO import StringIO
-from datetime import datetime
 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
 from zope.securitypolicy.interfaces import IPrincipalRoleManager
+from zope.component import createObject, getUtility
+from waeup.kofa.configuration import SessionConfiguration
+from waeup.kofa.interfaces import IUserAccount
 from waeup.kofa.browser.tests.test_pdf import samples_dir
 from waeup.kofa.applicants.container import ApplicantsContainer
@@ -31,5 +35,5 @@
 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup, PH_LEN
 
-session_1 = datetime.now().year - 2
+session_1 = datetime.datetime.now().year - 2
 SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg')
 
@@ -127,5 +131,5 @@
         self.assertTrue('<span>55</span>' in self.browser.contents)
         configuration = CustomSessionConfiguration()
-        configuration.academic_session = datetime.now().year - 2
+        configuration.academic_session = datetime.datetime.now().year - 2
         self.app['configuration'].addSessionConfiguration(configuration)
         # Admission checking fee is 0, thus admission checking payment
@@ -290,2 +294,61 @@
         open(path, 'wb').write(self.browser.contents)
         print "Sample ictwk_application_slip.pdf written to %s" % path
+
+    def test_transcript_payment(self):
+        configuration = SessionConfiguration()
+        configuration.academic_session = session_1
+        self.app['configuration'].addSessionConfiguration(configuration)
+        # Add special application container
+        applicantscontainer = ApplicantsContainer()
+        applicantscontainer.year = session_1
+        applicantscontainer.application_fee = 200.0
+        applicantscontainer.code = u'trans1234'
+        applicantscontainer.prefix = 'trans'
+        applicantscontainer.title = u'This is a trans container'
+        applicantscontainer.application_category = 'no'
+        applicantscontainer.mode = 'create'
+        applicantscontainer.strict_deadline = True
+        applicantscontainer.with_picture = False
+        delta = datetime.timedelta(days=10)
+        applicantscontainer.startdate = datetime.datetime.now(pytz.utc) - delta
+        applicantscontainer.enddate = datetime.datetime.now(pytz.utc) + delta
+        self.app['applicants']['trans1234'] = applicantscontainer
+        # Add an applicant
+        applicant = createObject('waeup.Applicant')
+        # reg_number is the only field which has to be preset here
+        # because managers are allowed to edit this required field
+        applicant.reg_number = u'12345'
+        self.app['applicants']['trans1234'].addApplicant(applicant)
+        IUserAccount(
+            self.app['applicants']['trans1234'][
+            applicant.application_number]).setPassword('apwd')
+        # Login
+        self.browser.open(self.login_path)
+        self.browser.getControl(
+            name="form.login").value = applicant.applicant_id
+        self.browser.getControl(name="form.password").value = 'apwd'
+        self.browser.getControl("Login").click()
+        self.browser.getLink("Application record").click()
+        self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
+        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
+        self.browser.getControl(name="form.nationality").value = ['NG']
+        self.browser.getControl(name="form.firstname").value = 'Angela'
+        self.browser.getControl(name="form.lastname").value = 'Merkel'
+        self.browser.getControl(name="form.sex").value = ['f']
+        self.browser.getControl(name="form.no_copies").value = ['3']
+        self.browser.getControl(name="form.course_studied").value = ['CERT1']
+        self.browser.getControl(name="form.matric_number").value = '234'
+        self.browser.getControl(name="form.place_of_birth").value = 'Bochum'
+        self.browser.getControl(name="form.dispatch_address").value = 'Kuensche'
+        self.browser.getControl(name="form.perm_address").value = 'Kuensche'
+        self.browser.getControl(name="form.entry_mode").value = ['ug_ft']
+        self.browser.getControl(name="form.entry_session").value = ['2014']
+        self.browser.getControl(name="form.end_session").value = ['2015']
+        self.browser.getControl(name="form.phone.country").value = ['+234']
+        self.browser.getControl(name="form.phone.ext").value = '5678'
+        self.browser.getControl("Save").click()
+        self.browser.getControl("Add online payment ticket").click()
+        self.assertTrue('Payment ticket created' in self.browser.contents)
+        self.assertTrue('<span>200.0</span>' in self.browser.contents)
+        self.assertEqual(applicant.values()[0].amount_auth, 200.0)
+        return
