Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 10462)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 10463)
@@ -2828,4 +2828,62 @@
         self.assertEqual(self.student['studycourse'].current_level, 600)
 
+    def test_request_transcript(self):
+        IWorkflowState(self.student).setState('graduated')
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.student_id
+        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl("Login").click()
+        self.assertMatches(
+            '...You logged in...', self.browser.contents)
+        # Create payment ticket
+        self.browser.open(self.payments_path)
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['transcript']
+        self.browser.getControl("Create ticket").click()
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[0]
+        self.browser.getLink(value).click()
+        self.assertMatches('...Amount Authorized...',
+                           self.browser.contents)
+        self.assertEqual(self.student['payments'][value].amount_auth, 4567.0)
+        # Student is the payer of the payment ticket.
+        payer = IPayer(self.student['payments'][value])
+        self.assertEqual(payer.display_fullname, 'Anna Tester')
+        self.assertEqual(payer.id, self.student_id)
+        self.assertEqual(payer.faculty, 'fac1')
+        self.assertEqual(payer.department, 'dep1')
+        # We simulate the approval and fetch the pin
+        self.assertEqual(len(self.app['accesscodes']['TSC-0']),0)
+        self.browser.open(self.browser.url + '/fake_approve')
+        self.assertMatches('...Payment approved...',
+                          self.browser.contents)
+        pin = self.app['accesscodes']['TSC-0'].keys()[0]
+        parts = pin.split('-')[1:]
+        tscseries, tscnumber = parts
+        # Student can use the pin to send the transcript request
+        self.browser.open(self.student_path)
+        self.browser.getLink("Request transcript").click()
+        self.browser.getControl(name="ac_series").value = tscseries
+        self.browser.getControl(name="ac_number").value = tscnumber
+        self.browser.getControl(name="comment").value = 'Comment line 1 \nComment line2'
+        self.browser.getControl(name="address").value = 'Address line 1 \nAddress line2'
+        self.browser.getControl("Request transcript now").click()
+        self.assertMatches('...Transcript processing has been started...',
+                          self.browser.contents)
+        self.assertEqual(self.student.state, 'transcript requested')
+        self.assertMatches(
+            '... UTC K1000000 wrote:\n\nComment line 1 \n'
+            'Comment line2\n\nDispatch Address:\nAddress line 1 \n'
+            'Address line2\n\n', self.student.transcript_comment)
+        # The comment has been logged
+        logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'students.log')
+        logcontent = open(logfile).read()
+        self.assertTrue(
+            'K1000000 - students.browser.StudentTranscriptRequestPage - '
+            'K1000000 - comment: Comment line 1 <br>Comment line2\n'
+            in logcontent)
+        
+
 class StudentRequestPWTests(StudentsFullSetup):
     # Tests for student registration
Index: /main/waeup.kofa/trunk/src/waeup/kofa/testing.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/testing.py	(revision 10462)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/testing.py	(revision 10463)
@@ -284,5 +284,5 @@
 #:
 #: `<6-DIGITS>`
-#:    matches a sequence of 10 digits. Useful when checking accesscode
+#:    matches a sequence of 6 digits. Useful when checking accesscode
 #:    numbers if you don't know the exact (random) code.
 #:
