Ignore:
Timestamp:
21 Sep 2012, 08:19:35 (12 years ago)
Author:
uli
Message:

Rollback r9209. Looks like multiple merges from trunk confuse svn when merging back into trunk.

Location:
main/waeup.kofa/branches/uli-zc-async
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-zc-async

  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/applicant.py

    r9209 r9211  
    2727from zope.securitypolicy.interfaces import IPrincipalRoleManager
    2828from zope.interface import implementedBy
    29 from zope.schema.interfaces import RequiredMissing, ConstraintNotSatisfied
     29from zope.schema.interfaces import RequiredMissing
    3030from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
    3131from waeup.kofa.image import KofaImageFile
     
    3636from waeup.kofa.interfaces import MessageFactory as _
    3737from waeup.kofa.students.vocabularies import RegNumNotInSource
    38 from waeup.kofa.students.studycourse import StudentStudyCourse
    3938from waeup.kofa.utils.helpers import attrs_to_fields
    4039from waeup.kofa.applicants.interfaces import IApplicant, IApplicantEdit
     
    119118        if self.course_admitted is None:
    120119            return False, _('No course admitted provided.')
    121         # Set student attributes
     120        # Add student object
    122121        try:
    123122            for name in self.create_names:
    124123                setattr(student, name, getattr(self, name, None))
    125124        except RequiredMissing, err:
    126             return False, 'RequiredMissing: %s' % err
    127         except:
    128             return False, 'Error: %s' % err
    129         # Finally prove if the certificate still exists
    130         try:
    131             StudentStudyCourse().certificate = self.course_admitted
    132         except ConstraintNotSatisfied, err:
    133             return False, 'ConstraintNotSatisfied: %s' % self.course_admitted.code
    134         # Add student
     125            return False, _('RequiredMissing: %s' % err)
    135126        site = grok.getSite()
    136127        site['students'].addStudent(student)
    137         # Save student_id
    138128        self.student_id = student.student_id
    139         # Fire transitions
    140129        IWorkflowInfo(self).fireTransition('create')
    141130        IWorkflowInfo(student).fireTransition('admit')
     131
    142132        # Set password
    143133        IUserAccount(student).setPassword(self.application_number)
     134
    144135        # Save the certificate and set session attributes
    145136        student['studycourse'].certificate = self.course_admitted
     
    151142        # Update the catalog
    152143        notify(grok.ObjectModifiedEvent(student))
     144
    153145        # Save application slip
    154146        self._createApplicationPDF(student, view=view)
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/batching.py

    r9209 r9211  
    4040    grok.provides(IBatchProcessor)
    4141    grok.context(Interface)
    42     util_name = 'applicantscontainerprocessor'
     42    util_name = 'applicants container processor'
    4343    grok.name(util_name)
    4444
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/browser.py

    r9209 r9211  
    309309    pnav = 3
    310310
    311     @property
    312     def form_fields(self):
    313         form_fields = grok.AutoFields(IApplicantsContainer).omit('title')
    314         form_fields['description'].custom_widget = HTMLDisplayWidget
    315         form_fields[
    316             'startdate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    317         form_fields[
    318             'enddate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    319         if self.request.principal.id == 'zope.anybody':
    320             form_fields = form_fields.omit(
    321                 'code', 'prefix', 'year', 'mode',
    322                 'strict_deadline', 'application_category')
    323         return form_fields
     311    form_fields = grok.AutoFields(IApplicantsContainer).omit('title')
     312    form_fields['description'].custom_widget = HTMLDisplayWidget
     313    form_fields[
     314        'startdate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     315    form_fields[
     316        'enddate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    324317
    325318    @property
     
    501494    grok.template('applicantdisplaypage')
    502495    form_fields = grok.AutoFields(IApplicant).omit(
    503         'locked', 'course_admitted', 'password', 'suspended')
     496        'locked', 'course_admitted', 'password')
    504497    label = _('Applicant')
    505498    pnav = 3
    506     hide_hint = False
    507499
    508500    @property
     
    547539    grok.name('base')
    548540    form_fields = grok.AutoFields(IApplicant).select(
    549         'applicant_id','email', 'course1')
     541        'applicant_id', 'firstname', 'lastname','email', 'course1')
    550542
    551543class CreateStudentPage(UtilityView, grok.View):
     
    716708
    717709    def update(self):
    718         if self.context.state in ('initialized', 'started', 'paid'):
     710        if self.context.state in ('initialized', 'started'):
    719711            self.flash(
    720                 _('Please pay and submit before trying to download the application slip.'))
     712                _('Please pay before trying to download the application slip.'))
    721713            return self.redirect(self.url(self.context))
    722714        return
     
    890882    form_fields = grok.AutoFields(IApplicantEdit).omit(
    891883        'locked', 'course_admitted', 'student_id',
    892         'suspended'
     884        'screening_score',
    893885        )
    894886    form_fields['applicant_id'].for_display = True
     
    10421034        return
    10431035
    1044     @action(_('Send login credentials to email address'), style='primary')
     1036    @action(_('Get login credentials'), style='primary')
    10451037    def register(self, **data):
    10461038        if not self.captcha_result.is_valid:
     
    10931085        # Send email with credentials
    10941086        login_url = self.url(grok.getSite(), 'login')
    1095         url_info = u'Login: %s' % login_url
    10961087        msg = _('You have successfully been registered for the')
    10971088        if kofa_utils.sendCredentials(IUserAccount(applicant),
    1098             password, url_info, msg):
     1089            password, login_url, msg):
    10991090            email_sent = applicant.email
    11001091        else:
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/browser_templates/applicantdisplaypage.pt

    r9209 r9211  
    1 <h2 i18n:domain="waeup.kofa">
    2   ...
    3   <span tal:replace="context/translated_state">APPLICATIONSTATE
    4   </span>
    5   <span tal:omit-tag=""
    6     i18n:translate="" tal:condition="context/suspended">(account suspended)
    7   </span>
    8   ...
     1<h2>
     2... <span tal:replace="context/translated_state">APPLICATIONSTATE</span> ...
    93</h2>
    104
     
    2014  <tbody>
    2115    <tal:widgets content="structure provider:widgets" />
    22     <tr tal:condition="view/getCourseAdmitted">
     16    <tr>
    2317      <td class="fieldname" i18n:translate="">
    2418          Admitted Course of Study:
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/browser_templates/applicanteditpage.pt

    r9209 r9211  
    33      autocomplete="off">
    44
    5   <h2 i18n:domain="waeup.kofa">
    6     ...
    7     <span tal:replace="context/translated_state">APPLICATIONSTATE
    8     </span>
    9     <span tal:omit-tag=""
    10       i18n:translate="" tal:condition="context/suspended">(account suspended)
    11     </span>
    12     ...
     5  <h2>
     6  ... <span tal:replace="context/translated_state">APPLICATIONSTATE</span> ...
    137  </h2>
    148
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/browser_templates/applicantregemailsent.pt

    r9209 r9211  
    2929    <tr>
    3030  </table>
    31   <p>
    32     <span i18n:translate="">Print this page and proceed to the</span>
     31  <p i18n:translate="">
     32    Print this page and proceed to the
    3333    <a tal:attributes="href python: view.url(layout.site, 'login')">login form</a>.
    34     <span i18n:translate="">Please note that passwords are case-sensitive,
     34    Please note that passwords are case-sensitive,
    3535    <br />when entering your credentials, and keep your password secret!
    36     </span>
    3736  </p>
    3837  <p tal:condition = "view/email">
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/browser_templates/applicantscontainerpage.pt

    r9209 r9211  
    1 <table class="form-table">
     1<span tal:condition="view/introduction" tal:omit-tag="">
     2  <p tal:content="structure view/introduction">INTRODUCTION</p>
     3</span>
     4
     5<table class="form-table" tal:condition="layout/isAuthenticated">
    26  <tbody>
    37    <tal:block repeat="widget view/widgets">
     
    1519  </tbody>
    1620</table>
    17 
    18 <span tal:condition="view/introduction" tal:omit-tag="">
    19   <p tal:content="structure view/introduction">INTRODUCTION</p>
    20 </span>
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/browser_templates/applicantsrootpage.pt

    r9209 r9211  
    2525      </td>
    2626      <td>
    27       <span tal:content="python: layout.formatTZDate(entry.startdate)">START</span>
     27      <span tal:content="python: layout.formatDate(entry.startdate)">START</span>
    2828      -
    29       <span tal:content="python: layout.formatTZDate(entry.enddate)">END</span>
     29      <span tal:content="python: layout.formatDate(entry.enddate)">END</span>
    3030      </td>
    3131    </tr>
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/container.py

    r9209 r9211  
    5151    description_dict = {}
    5252
    53     local_roles = []
     53    @property
     54    def local_roles(self):
     55        return []
    5456
    5557    def archive(self, app_ids=None):
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/dynamicroles.py

    r9209 r9211  
    2424import grok
    2525from zope.securitypolicy.interfaces import IPrincipalRoleManager
    26 from zope.securitypolicy.principalrole import AnnotationPrincipalRoleManager
    2726from waeup.kofa.applicants.interfaces import IApplicant
     27from waeup.kofa.students.dynamicroles import StudentPrincipalRoleManager
    2828
    2929# All components in here have the same context: Applicant instances
    3030grok.context(IApplicant)
    3131
    32 class ApplicantPrincipalRoleManager(AnnotationPrincipalRoleManager,
    33                                     grok.Adapter):
     32class ApplicantPrincipalRoleManager(StudentPrincipalRoleManager):
     33
    3434    grok.provides(IPrincipalRoleManager)
    3535
    3636    #: The attribute name to lookup for additional roles
    3737    extra_attrib = 'course1'
     38    subcontainer = None
    3839
    3940    # Role name mapping:
     
    4445        'waeup.local.ClearanceOfficer':'waeup.ApplicationsOfficer',
    4546        }
    46 
    47     def getRolesForPrincipal(self, principal_id):
    48         """Get roles for principal with id `principal_id`.
    49 
    50         Different to the default implementation, this method also
    51         takes into account local roles set on any department connected
    52         to the context student.
    53 
    54         If the given principal has at least one of the
    55         `external_rolenames` roles granted for the external object, it
    56         additionally gets `additional_rolename` role for the context
    57         student.
    58 
    59         For the additional roles the `extra_attrib` and all its parent
    60         objects are looked up, because 'role inheritance' does not
    61         work on that basic level of permission handling.
    62 
    63         Some advantages of this approach:
    64 
    65         - we don't have to store extra local roles for clearance
    66           officers in ZODB for each student
    67 
    68         - when local roles on a department change, we don't have to
    69           update thousands of students; the local role is assigned
    70           dynamically.
    71 
    72         Disadvantage:
    73 
    74         - More expensive role lookups when a clearance officer wants
    75           to see an student form.
    76 
    77         This implementation is designed to be usable also for other
    78         contexts than students. You can inherit from it and set
    79         different role names to lookup/set easily via the static class
    80         attributes.
    81         """
    82         apr_manager = AnnotationPrincipalRoleManager(self._context)
    83         result = apr_manager.getRolesForPrincipal(principal_id)
    84         if result != []:
    85             # If there are local roles defined here, no additional
    86             # lookup is done.
    87             return result
    88         # The principal has no local roles yet. Let's lookup the
    89         # connected course, dept, etc.
    90         obj = getattr(self._context, self.extra_attrib, None)
    91         # Lookup local roles for connected course and all parent
    92         # objects. This way we fake 'role inheritance'.
    93         while obj is not None:
    94             extra_roles = IPrincipalRoleManager(obj).getRolesForPrincipal(
    95                 principal_id)
    96             for role_id, setting in extra_roles:
    97                 if role_id in self.rolename_mapping.keys():
    98                     # Grant additional role
    99                     # permissions (allow, deny or unset)
    100                     # according to the rolename mapping above.
    101                     result.append(
    102                         (self.rolename_mapping[role_id], setting))
    103                     return result
    104             obj = getattr(obj, '__parent__', None)
    105         return result
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/export.py

    r9209 r9211  
    8383        elif name == 'history':
    8484            value = value.messages
    85         elif name == 'phone' and value is not None:
    86             # Append hash '#' to phone numbers to circumvent
    87             # unwanted excel automatic
    88             value = str('%s#' % value)
    8985        return super(
    9086            ApplicantsExporter, self).mangle_value(
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/interfaces.py

    r9209 r9211  
    1818"""Interfaces of the university application package.
    1919"""
    20 from datetime import datetime
    2120from grokcore.content.interfaces import IContainer
    2221from zc.sourcefactory.contextual import BasicContextualSourceFactory
     
    3029from waeup.kofa.schema import TextLineChoice, FormattedDate
    3130from waeup.kofa.interfaces import (
    32     IKofaObject, validate_email,
     31    IKofaObject, year_range, validate_email,
    3332    SimpleKofaVocabulary)
    3433from waeup.kofa.interfaces import MessageFactory as _
     
    4241
    4342_marker = object() # a marker different from None
    44 
    45 def year_range():
    46     curr_year = datetime.now().year
    47     return range(curr_year - 2, curr_year + 5)
    4843
    4944class RegNumInSource(ValidationError):
     
    328323    application_number = Attribute('The key under which the record is stored')
    329324
    330     suspended = schema.Bool(
    331         title = _(u'Account suspended'),
    332         default = False,
    333         required = False,
    334         )
    335 
    336325    applicant_id = schema.TextLine(
    337326        title = _(u'Applicant Id'),
     
    404393        required = False,
    405394        )
     395    screening_venue = schema.TextLine(
     396        title = _(u'Screening Venue'),
     397        required = False,
     398        )
     399    screening_score = schema.Int(
     400        title = _(u'Screening Score'),
     401        required = False,
     402        )
    406403    student_id = schema.TextLine(
    407404        title = _(u'Student Id'),
     
    463460        required = False,
    464461        )
     462    screening_score = schema.Int(
     463        title = _(u'Screening Score'),
     464        required = False,
     465        readonly = True,
     466        )
     467    screening_venue = schema.TextLine(
     468        title = _(u'Screening Venue'),
     469        required = False,
     470        readonly = True,
     471        )
    465472    course_admitted = schema.Choice(
    466473        title = _(u'Admitted Course of Study'),
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/tests/test_applicantcopier.py

    r9209 r9211  
    2121import os
    2222import grok
    23 from datetime import datetime
    2423from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
    2524from zope.event import notify
     
    2928from waeup.kofa.interfaces import IExtFileStore, IFileStoreNameChooser
    3029from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
    31 
    32 session = datetime.now().year - 2
    3330
    3431class ApplicantCopierFunctionalTests(ApplicantsFullSetup):
     
    7067        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
    7168        self.browser.getControl("Save").click()
    72         # Maybe the certificate has meanwhile been removed
    73         del self.app['faculties']['fac1']['dep1'].certificates['CERT1']
    74         (success, msg) = self.applicant.createStudent()
    75         self.assertFalse(success)
    76         self.assertTrue('ConstraintNotSatisfied: CERT1' in msg)
    77         # Ok, lets add the certificate and try again
    78         self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
    79             self.certificate)
    8069        (success, msg) = self.applicant.createStudent()
    8170        self.assertTrue('created' in msg)
     
    9382        self.assertEqual(student.firstname, 'John')
    9483        self.assertEqual(student.lastname, 'Tester')
    95         # student_id set in application record?
    96         self.assertEqual(self.applicant.student_id, student.student_id)
    9784        # Check if passport image has been copied
    9885        storage = getUtility(IExtFileStore)
     
    123110        # Has the student studycourse the correct attributes?
    124111        self.assertEqual(student['studycourse'].certificate.code, 'CERT1')
    125         self.assertEqual(student['studycourse'].entry_session, session)
     112        self.assertEqual(student['studycourse'].entry_session, 2009)
    126113        self.assertEqual(student['studycourse'].entry_mode, 'ug_ft')
    127         self.assertEqual(student['studycourse'].current_session, session)
     114        self.assertEqual(student['studycourse'].current_session, 2009)
    128115        self.assertEqual(student['studycourse'].current_level, 100)
    129116
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/tests/test_authentication.py

    r9209 r9211  
    6464    email = None
    6565    phone = None
    66     suspended = False
    6766
    6867
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/tests/test_browser.py

    r9209 r9211  
    2323import tempfile
    2424import grok
    25 from datetime import datetime
    2625from StringIO import StringIO
    2726from datetime import datetime, date, timedelta
     
    4746PH_LEN = 2059  # Length of placeholder file
    4847
    49 session_1 = datetime.now().year - 2
    50 container_name_1 = u'app%s' % session_1
    51 session_2 = datetime.now().year - 1
    52 container_name_2 = u'app%s' % session_2
    53 
    5448class ApplicantsFullSetup(FunctionalTestCase):
    5549    # A test case that only contains a setup and teardown
     
    8680        self.manage_root_path = self.root_path + '/@@manage'
    8781        self.add_container_path = self.root_path + '/@@add'
    88         self.container_path = 'http://localhost/app/applicants/%s' % container_name_1
     82        self.container_path = 'http://localhost/app/applicants/app2009'
    8983        self.manage_container_path = self.container_path + '/@@manage'
    9084
    9185        # Add an applicants container
    9286        applicantscontainer = ApplicantsContainer()
    93         applicantscontainer.code = container_name_1
     87        applicantscontainer.code = u'app2009'
    9488        applicantscontainer.prefix = 'app'
    95         applicantscontainer.year = session_1
    96         applicantscontainer.title = u'This is the %s container' % container_name_1
     89        applicantscontainer.year = 2009
     90        applicantscontainer.title = u'This is the app2009 container'
    9791        applicantscontainer.application_category = 'basic'
    9892        applicantscontainer.mode = 'create'
     
    10195        applicantscontainer.startdate = datetime.now(pytz.utc) - delta
    10296        applicantscontainer.enddate = datetime.now(pytz.utc) + delta
    103         self.app['applicants'][container_name_1] = applicantscontainer
    104         self.applicantscontainer = self.app['applicants'][container_name_1]
     97        self.app['applicants']['app2009'] = applicantscontainer
     98        self.applicantscontainer = self.app['applicants']['app2009']
    10599
    106100        # Populate university
     
    141135        self.applicant.reg_number = u'1234'
    142136        self.applicant.course1 = certificate
    143         app['applicants'][container_name_1].addApplicant(self.applicant)
     137        app['applicants']['app2009'].addApplicant(self.applicant)
    144138        IUserAccount(
    145             self.app['applicants'][container_name_1][
     139            self.app['applicants']['app2009'][
    146140            self.applicant.application_number]).setPassword('apwd')
    147141        self.manage_path = 'http://localhost/app/applicants/%s/%s/%s' % (
    148             container_name_1, self.applicant.application_number, 'manage')
     142            'app2009', self.applicant.application_number, 'manage')
    149143        self.edit_path = 'http://localhost/app/applicants/%s/%s/%s' % (
    150             container_name_1, self.applicant.application_number, 'edit')
     144            'app2009', self.applicant.application_number, 'edit')
    151145        self.view_path = 'http://localhost/app/applicants/%s/%s' % (
    152             container_name_1, self.applicant.application_number)
     146            'app2009', self.applicant.application_number)
    153147
    154148    def login(self):
     
    309303            'There were errors' in self.browser.contents)
    310304        self.browser.getControl(name="form.prefix").value = ['app']
    311         self.browser.getControl(name="form.year").value = [str(session_2)]
     305        self.browser.getControl(name="form.year").value = ['2010']
    312306        self.browser.getControl(name="form.mode").value = ['create']
    313307        self.browser.getControl(
     
    323317        self.browser.open(self.add_container_path)
    324318        self.browser.getControl(name="form.prefix").value = ['app']
    325         self.browser.getControl(name="form.year").value = [str(session_2)]
     319        self.browser.getControl(name="form.year").value = ['2010']
    326320        self.browser.getControl(name="form.mode").value = ['create']
    327321        self.browser.getControl(
     
    332326        self.browser.open(self.manage_root_path)
    333327        ctrl = self.browser.getControl(name='val_id')
    334         ctrl.getControl(value=container_name_2).selected = True
     328        ctrl.getControl(value='app2010').selected = True
    335329        self.browser.getControl("Remove selected", index=0).click()
    336330        self.assertTrue('Successfully removed:' in self.browser.contents)
    337331        self.browser.open(self.add_container_path)
    338332        self.browser.getControl(name="form.prefix").value = ['app']
    339         self.browser.getControl(name="form.year").value = [str(session_2)]
     333        self.browser.getControl(name="form.year").value = ['2010']
    340334        self.browser.getControl(name="form.mode").value = ['create']
    341335        #self.browser.getControl(name="form.ac_prefix").value = ['APP']
     
    343337            name="form.application_category").value = ['basic']
    344338        self.browser.getControl("Add applicants container").click()
    345         del self.app['applicants'][container_name_2]
     339        del self.app['applicants']['app2010']
    346340        ctrl = self.browser.getControl(name='val_id')
    347         ctrl.getControl(value=container_name_2).selected = True
     341        ctrl.getControl(value='app2010').selected = True
    348342        self.browser.getControl("Remove selected", index=0).click()
    349343        self.assertMatches('...Could not delete...', self.browser.contents)
     
    471465        self.browser.open(self.slip_path)
    472466        self.assertTrue(
    473             'Please pay and submit before trying to download the application slip.'
     467            'Please pay before trying to download the application slip.'
    474468            in self.browser.contents)
    475469        # If applicant is in correct state the pdf slip can be opened.
    476         IWorkflowState(self.applicant).setState('submitted')
     470        IWorkflowState(self.applicant).setState('paid')
    477471        self.browser.open(self.manage_path)
    478472        self.browser.getLink("Download application slip").click()
     
    499493            self.browser.headers['content-length'], str(PH_LEN))
    500494
    501     def test_applicant_login(self):
    502         self.applicant.suspended = True
    503         self.login()
    504         self.assertTrue(
    505             'You entered invalid credentials.' in self.browser.contents)
    506         self.applicant.suspended = False
    507         self.browser.getControl("Login").click()
    508         self.assertTrue(
    509             'You logged in.' in self.browser.contents)
    510 
    511495    def test_applicant_access(self):
    512496        # Applicants can edit their record
    513497        self.browser.open(self.login_path)
    514498        self.login()
    515         self.assertTrue(
    516             'You logged in.' in self.browser.contents)
    517499        self.browser.open(self.edit_path)
    518500        self.assertTrue(self.browser.url != self.login_path)
     
    717699            in self.browser.contents)
    718700        configuration = SessionConfiguration()
    719         configuration.academic_session = session_1
     701        configuration.academic_session = 2009
    720702        configuration.application_fee = 200.0
    721703        self.app['configuration'].addSessionConfiguration(configuration)
     
    745727        payment_id = self.applicant.keys()[0]
    746728        payment = self.applicant[payment_id]
    747         self.assertEqual(payment.p_item,'This is the %s container' % container_name_1)
    748         self.assertEqual(payment.p_session, session_1)
     729        self.assertEqual(payment.p_item,'This is the app2009 container')
     730        self.assertEqual(payment.p_session,2009)
    749731        self.assertEqual(payment.p_category,'application')
    750732        self.assertEqual(payment.amount_auth,200.0)
     
    839821        self.browser.getControl("Final Submit").click()
    840822        self.assertTrue(
    841             'Application submitted' in self.browser.contents)
     823            '... submitted ...' in self.browser.contents)
    842824        # ... or allow submission after deadline.
    843825        IWorkflowState(self.applicant).setState('paid')
     
    848830        self.browser.getControl("Final Submit").click()
    849831        self.assertTrue(
    850             'Application submitted' in self.browser.contents)
     832            '... submitted ...' in self.browser.contents)
    851833        self.browser.goBack(count=1)
    852834        self.browser.getControl("Save").click()
     
    935917        self.browser.getControl(name="form.phone.area").value = '555'
    936918        self.browser.getControl(name="form.phone.ext").value = '6666666'
    937         self.browser.getControl("Send login credentials").click()
     919        self.browser.getControl("Get login credentials").click()
    938920        self.assertEqual(self.browser.url,
    939921            self.container_path + '/registration_complete?email=xx%40yy.zz')
     
    962944        self.browser.getControl(name="form.reg_number").value = 'anynumber'
    963945        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
    964         self.browser.getControl("Send login credentials").click()
     946        self.browser.getControl("Get login credentials").click()
    965947        self.assertTrue('No application record found.'
    966948            in self.browser.contents)
     
    972954        self.browser.getControl(name="form.reg_number").value = '1234'
    973955        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
    974         self.browser.getControl("Send login credentials").click()
     956        self.browser.getControl("Get login credentials").click()
    975957        self.assertTrue('An error occurred.' in self.browser.contents)
    976958        # Let's set this attribute manually
     
    981963        self.browser.getControl(name="form.reg_number").value = '1234'
    982964        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
    983         self.browser.getControl("Send login credentials").click()
     965        self.browser.getControl("Get login credentials").click()
    984966        # Anonymous is not informed that firstname verification failed.
    985967        # It seems that the record doesn't exist.
     
    991973        self.browser.getControl(name="form.firstname").value = 'John'
    992974        self.browser.getControl(name="form.reg_number").value = '1234'
    993         self.browser.getControl("Send login credentials").click()
     975        self.browser.getControl("Get login credentials").click()
    994976        self.assertTrue('Your password has already been set and used.'
    995977            in self.browser.contents)
    996978        #IUserAccount(
    997         #    self.app['applicants'][container_name_1][
     979        #    self.app['applicants']['app2009'][
    998980        #    self.applicant.application_number]).context.password = None
    999981        # Even without unsetting the password we can re-register if state
     
    1005987        self.browser.getControl(name="form.reg_number").value = '1234'
    1006988        self.browser.getControl(name="form.email").value = 'new@yy.zz'
    1007         self.browser.getControl("Send login credentials").click()
     989        self.browser.getControl("Get login credentials").click()
    1008990        # Yeah, we succeded ...
    1009991        self.assertTrue('Your registration was successful.'
     
    10211003        self.browser.getControl(name="form.identifier").value = '1234'
    10221004        self.browser.getControl(name="form.email").value = 'aa@aa.ng'
    1023         self.browser.getControl("Send login credentials").click()
     1005        self.browser.getControl("Get login credentials").click()
    10241006        self.assertTrue('No record found' in self.browser.contents)
    10251007        self.applicant.email = 'aa@aa.ng'
     
    10291011        self.browser.getControl(name="form.identifier").value = '1234'
    10301012        self.browser.getControl(name="form.email").value = 'aa@aa.ng'
    1031         self.browser.getControl("Send login credentials").click()
     1013        self.browser.getControl("Get login credentials").click()
    10321014        self.assertTrue(
    10331015            'An email with your user name and password has been sent'
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/tests/test_export.py

    r9209 r9211  
    120120        applicant.course_admitted = self.certificate
    121121        applicant.notice = u'Some notice\nin lines.'
     122        applicant.screening_score = 98
     123        applicant.screening_venue = u'Exam Room'
    122124        applicant.password = 'any password'
    123125        result_entry = ResultEntry(
     
    142144            'course_admitted,date_of_birth,display_fullname,email,firstname,'
    143145            'history,lastname,locked,middlename,notice,password,phone,'
    144             'reg_number,sex,state,'
    145             'student_id,suspended,container_code\r\n'
     146            'reg_number,screening_score,screening_venue,sex,state,'
     147            'student_id,container_code\r\n'
    146148            'dp2011_654321,,654321,,,,,Anna Tester,,Anna,'
    147149            in result)
    148150        self.assertTrue(
    149151            'Application initialized by system\'],Tester,'
    150             '0,,,,,,,initialized,,0,dp2011\r\n'
     152            '0,,,,,,,,,initialized,,dp2011\r\n'
    151153            in result)
    152154        return
     
    166168            'course_admitted,date_of_birth,display_fullname,email,firstname,'
    167169            'history,lastname,locked,middlename,notice,password,phone,'
    168             'reg_number,sex,state,'
    169             'student_id,suspended,container_code\r\n'
     170            'reg_number,screening_score,screening_venue,sex,state,'
     171            'student_id,container_code\r\n'
    170172            'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,'
    171173            'Anna M. Tester,anna@sample.com,Anna,'
     
    174176            'Application initialized by system\'],'
    175177            'Tester,0,M.,"Some notice\nin lines.",any password,'
    176             '+234-123-12345#,123456,f,initialized,,0,dp2011\r\n'
     178            '+234-123-12345,123456,98,Exam Room,f,initialized,,dp2011\r\n'
    177179            in result)
    178180
     
    190192            'course_admitted,date_of_birth,display_fullname,email,firstname,'
    191193            'history,lastname,locked,middlename,notice,password,phone,'
    192             'reg_number,sex,state,'
    193             'student_id,suspended,container_code\r\n'
     194            'reg_number,screening_score,screening_venue,sex,state,'
     195            'student_id,container_code\r\n'
    194196            'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,'
    195197            'Anna M. Tester,anna@sample.com,Anna,'
     
    198200            'Application initialized by system\'],'
    199201            'Tester,0,M.,"Some notice\nin lines.",any password,'
    200             '+234-123-12345#,123456,f,initialized,,0,dp2011\r\n'
    201             in result)
    202         return
     202            '+234-123-12345,123456,98,Exam Room,f,initialized,,dp2011\r\n'
     203            in result)
     204        return
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/utils.py

    r9209 r9211  
    3939    SEPARATORS_DICT = {
    4040      'form.course1': _(u'Desired Study Courses'),
    41       'form.student_id': _(u'Process Data'),
     41      'form.screening_score': _(u'Process Data'),
    4242      }
    4343
     
    4545        """Set the payment data of an applicant.
    4646        """
    47         timestamp = ("%d" % int(time()*10000))[1:]
     47        timestamp = "%d" % int(time()*1000)
    4848        container_fee = container.application_fee
    4949        if container_fee:
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/viewlets.py

    r9209 r9211  
    183183        """Get a URL to the target...
    184184        """
    185         if self.context.state in ('initialized', 'started', 'paid'):
     185        if self.context.state in ('initialized', 'started'):
    186186            return
    187187        return self.view.url(self.view.context, self.target)
     
    204204
    205205class PaymentReceiptActionButton(ManageActionButton):
    206     grok.order(9) # This button should always be the last one.
     206    grok.order(1)
    207207    grok.context(IApplicantOnlinePayment)
    208208    grok.view(OnlinePaymentDisplayFormPage)
     
    219219
    220220class ApprovePaymentActionButton(ManageActionButton):
    221     grok.order(8)
     221    grok.order(2)
    222222    grok.context(IApplicantOnlinePayment)
    223223    grok.view(OnlinePaymentDisplayFormPage)
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/applicants/workflow.py

    r9209 r9211  
    150150        source = PAID,
    151151        destination = STARTED),
    152     Transition(
    153         transition_id = 'reset7',
    154         title = _('Reset application to admitted'),
    155         msg = _('Application reset to admitted'),
    156         source = CREATED,
    157         destination = ADMITTED),
    158152    )
    159153
Note: See TracChangeset for help on using the changeset viewer.