Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py	(revision 7354)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py	(revision 7355)
@@ -114,14 +114,8 @@
         # Save the certificate
         student['studycourse'].certificate = self.course_admitted
-        # Create StudentApplication object ...
-        #application = createObject(u'waeup.StudentApplication')
-        # ... copy applicant base data
-        #form_fields = grok.AutoFields(IApplicantBaseData)
-        #field_names = [i.__name__ for i in form_fields]
-        #for name in field_names:
-        #    value = getattr(self,name,None)
-        #    if value:
-        #        setattr(application,name,value)
-        #site['students'][student.student_id]['application'] = application
+        # Copy passport image
+
+        # Save application slip (ExportPDFPage)
+
         return True, 'Student %s created' % student.student_id
 
Index: /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_applicantcopier.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_applicantcopier.py	(revision 7355)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_applicantcopier.py	(revision 7355)
@@ -0,0 +1,85 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Tests for the creation of student containers with data from admitted applicants.
+"""
+import os
+from hurry.workflow.interfaces import IWorkflowInfo
+from zope.component import getUtility
+from waeup.sirp.testing import FunctionalLayer
+from waeup.sirp.interfaces import IExtFileStore, IFileStoreNameChooser
+from waeup.sirp.applicants.tests.test_browser import ApplicantsFullSetup
+
+class ApplicantCopierFunctionalTests(ApplicantsFullSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(ApplicantCopierFunctionalTests, self).setUp()
+        return
+
+    def test_copier(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.manage_path)
+        self.fill_correct_values()
+        self.browser.getControl("Save").click()
+        # Upload a passport picture
+        ctrl = self.browser.getControl(name='form.passport')
+        file_obj = open(
+            os.path.join(os.path.dirname(__file__), 'test_image.jpg'),'rb')
+        file_ctrl = ctrl.mech_control
+        file_ctrl.add_file(file_obj, filename='my_photo.jpg')
+        self.browser.getControl("Save").click() # submit form
+        storage = getUtility(IExtFileStore)
+        file_id = IFileStoreNameChooser(self.applicant).chooseName()
+        # The stored image can be fetched
+        fd = storage.getFile(file_id)
+        file_len_orig = len(fd.read())
+        # Let's try to create the student
+        (success, msg) = self.applicant.createStudent()
+        self.assertTrue(msg == 'Applicant has not yet been admitted.')
+        IWorkflowInfo(self.applicant).fireTransition('start')
+        IWorkflowInfo(self.applicant).fireTransition('pay')
+        IWorkflowInfo(self.applicant).fireTransition('submit')
+        IWorkflowInfo(self.applicant).fireTransition('admit')
+        (success, msg) = self.applicant.createStudent()
+        self.assertTrue(msg == 'No course admitted provided.')
+        self.browser.open(self.manage_path)
+        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
+        self.browser.getControl("Save").click()
+        (success, msg) = self.applicant.createStudent()
+        self.assertTrue('created' in msg)
+        student_id = msg.split()[1]
+        # View student container just created
+        student = self.app['students'][student_id]
+        student_path = 'http://localhost/app/students/%s' % student_id
+        self.browser.open(student_path)
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.url, student_path)
+        # Check if passport image has been copied
+        storage = getUtility(IExtFileStore)
+        file_id = IFileStoreNameChooser(
+            student).chooseName(attr='application_slip')
+        fd = storage.getFile(file_id)
+        file_len = len(fd.read())
+        self.assertEqual(file_len_orig, file_len)
+        # Check if application slip exists
+        self.assertTrue('Applicant Slip' in self.browser.contents)
+        self.browser.getLink("Applicant Slip").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
