Index: /main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/applicant.py
===================================================================
--- /main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/applicant.py	(revision 8670)
+++ /main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/applicant.py	(revision 8671)
@@ -30,4 +30,7 @@
     grok.provides(ICustomApplicant)
 
+    create_names = Applicant.create_names + [
+        'lga', 'nationality', 'perm_address']
+
 # Set all attributes of Applicant required in IApplicant as field
 # properties. Doing this, we do not have to set initial attributes
Index: /main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests.py
===================================================================
--- /main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests.py	(revision 8670)
+++ /main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests.py	(revision 8671)
@@ -20,4 +20,7 @@
 import tempfile
 import datetime
+import grok
+import pytz
+from zope.event import notify
 from zope.intid.interfaces import IIntIds
 from zope.interface.verify import verifyClass, verifyObject
@@ -26,4 +29,5 @@
 from zope.catalog.interfaces import ICatalog
 from zope.testbrowser.testing import Browser
+from hurry.workflow.interfaces import IWorkflowState
 from waeup.kofa.app import University
 from waeup.kofa.university.faculty import Faculty
@@ -61,13 +65,5 @@
         setSite(app)
 
-        # Add an two different applicants containers
-        self.pgcontainer = ApplicantsContainer()
-        self.pgcontainer.code = u'pgft2011'
-        self.pgcontainer.prefix = u'pgft'
-        self.pgcontainer.application_category = u'pg_ft'
-        self.pgcontainer.year = 2011
-        self.pgcontainer.application_fee = 300.0
-        self.pgcontainer.title = u'This is the pgft2011 container'
-        self.app['applicants']['pgft2011'] = self.pgcontainer
+        # Add an applicants containers
         self.ugcontainer = ApplicantsContainer()
         self.ugcontainer.code = u'putme2011'
@@ -79,4 +75,9 @@
         self.app['applicants']['app2011'] = self.ugcontainer
 
+        self.ugcontainer.mode = 'update'
+        delta = datetime.timedelta(days=10)
+        self.ugcontainer.startdate = datetime.datetime.now(pytz.utc) - delta
+        self.ugcontainer.enddate = datetime.datetime.now(pytz.utc) + delta
+
         # Populate university
         self.certificate = createObject('waeup.Certificate')
@@ -85,25 +86,11 @@
         self.certificate.start_level = 100
         self.certificate.end_level = 500
+        self.certificate.study_mode = u'ug_ft'
         self.app['faculties']['fac1'] = Faculty()
         self.app['faculties']['fac1']['dep1'] = Department()
         self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
             self.certificate)
-        self.certificate2 = createObject('waeup.Certificate')
-        self.certificate2.code = 'CERT2'
-        self.certificate2.application_category = 'pg_ft'
-        self.certificate2.start_level = 100
-        self.certificate2.end_level = 500
-        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
-            self.certificate2)
-
-        # Add (customized) applicants
-        pgapplicant = createObject(u'waeup.Applicant')
-        pgapplicant.firstname = u'Anna'
-        pgapplicant.lastname = u'Post'
-        self.app['applicants']['pgft2011'].addApplicant(pgapplicant)
-        self.pgapplication_number = pgapplicant.application_number
-        self.pgapplicant = self.app['applicants']['pgft2011'][
-            self.pgapplication_number]
-
+
+        # Add (customized) applicant
         ugapplicant = createObject(u'waeup.Applicant')
         ugapplicant.firstname = u'Klaus'
@@ -113,6 +100,4 @@
         self.ugapplicant = self.app['applicants']['app2011'][
             self.ugapplication_number]
-        self.pgapplicant_path = ('http://localhost/app/applicants/pgft2011/%s'
-            % self.pgapplication_number)
         self.ugapplicant_path = ('http://localhost/app/applicants/app2011/%s'
             % self.ugapplication_number)
@@ -133,41 +118,7 @@
         self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
         self.browser.getControl(name="form.lga").value = ['foreigner']
+        self.browser.getControl(name="form.nationality").value = ['NG']
         self.browser.getControl(name="form.sex").value = ['m']
         self.browser.getControl(name="form.email").value = 'xx@yy.zz'
-
-    def test_manage_and_view_applicant(self):
-        # Managers can manage pg applicants
-        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        # The IPGApplicant interface is really used in all pages
-        self.browser.open(self.pgapplicant_path)
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertTrue('Employer' in self.browser.contents)
-        self.browser.open(self.pgapplicant_path + '/manage')
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertTrue('Employer' in self.browser.contents)
-        self.browser.open(self.pgapplicant_path + '/edit')
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertTrue('Employer' in self.browser.contents)
-        self.browser.open(self.pgapplicant_path + '/application_slip.pdf')
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        # If we view the applicant in the ug container,
-        # the employer field doesn't appear
-        self.browser.open(self.ugapplicant_path)
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertFalse('Employer' in self.browser.contents)
-        self.browser.open(self.ugapplicant_path + '/manage')
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        # We can save the applicant
-        self.fill_correct_values()
-        self.browser.getControl(name="form.course1").value = ['CERT1']
-        self.browser.getControl("Save").click()
-        self.assertMatches('...Form has been saved...', self.browser.contents)
-        self.assertFalse('Employer' in self.browser.contents)
-        self.browser.open(self.ugapplicant_path + '/edit')
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertFalse('Employer' in self.browser.contents)
-        self.browser.open(self.ugapplicant_path + '/application_slip.pdf')
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        return
 
     def test_application_payment(self):
@@ -195,25 +146,28 @@
         self.assertEqual(payment.amount_auth, 200.0)
 
-        # PG applicants pay more
-        self.browser.open(self.pgapplicant_path)
-        self.browser.open(self.pgapplicant_path + '/manage')
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        return
+
+    def test_create_ugstudent(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        manage_path = 'http://localhost/app/applicants/%s/%s/%s' % (
+            'app2011', self.ugapplicant.application_number, 'manage')
+        self.browser.open(manage_path)
         self.fill_correct_values()
-        self.browser.getControl(name="form.course1").value = ['CERT2']
-        self.browser.getControl(name="form.reg_number").value = '2345'
-        self.browser.getControl(name="form.firstname").value = 'Anna'
-        self.browser.getControl("Save").click()
-        self.assertMatches('...Form has been saved...', self.browser.contents)
-        self.browser.getControl("Add online payment ticket").click()
-        self.assertMatches('...Payment ticket created...',
-                           self.browser.contents)
-        self.assertMatches('...Amount Authorized...',
-                           self.browser.contents)
-        payment_id = self.pgapplicant.keys()[0]
-        payment = self.pgapplicant[payment_id]
-        self.assertEqual(payment.p_item,'This is the pgft2011 container')
-        self.assertEqual(payment.p_session,2011)
-        self.assertEqual(payment.p_category,'application')
-        self.assertEqual(payment.amount_auth, 300.0)
+        self.browser.getControl("Save").click()
+        IWorkflowState(self.ugapplicant).setState('admitted')
+        self.browser.getControl(name="form.course1").value = ['CERT1']
+        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
+        self.browser.getControl("Save").click()
+        self.browser.getLink("Create student").click()
+        student_id =  self.app['students'].keys()[0]
+        self.assertTrue(('Student %s created' % student_id)
+            in self.browser.contents)
+        student = self.app['students'][student_id]
+        self.assertEqual(student.email, 'xx@yy.zz')
+        self.assertEqual(student.firstname, 'John')
+        self.assertEqual(student.lastname, 'Tester')
+        # Also additional attributes have been copied.
+        self.assertEqual(student.lga, 'foreigner')
+        self.assertEqual(student.nationality, 'NG')
         return
 
Index: /main/waeup.fceokene/trunk/src/waeup/fceokene/utils/utils.py
===================================================================
--- /main/waeup.fceokene/trunk/src/waeup/fceokene/utils/utils.py	(revision 8670)
+++ /main/waeup.fceokene/trunk/src/waeup/fceokene/utils/utils.py	(revision 8671)
@@ -181,6 +181,4 @@
         'basic': 'PUTME, PDE, PCE, PRENCE',
         'no': 'no application',
-        'pg_ft': 'Postgraduate Full-Time',
-        'pg_pt': 'Postgraduate Part-Time',
         'sandwich': 'Sandwich',
         'cest': 'Part-Time, Diploma, Certificate'
