Changeset 14150 for main


Ignore:
Timestamp:
2 Sep 2016, 09:03:03 (8 years ago)
Author:
Henrik Bettermann
Message:

Omit certain fields only if application is in update mode (= ude, utme).

Location:
main/waeup.aaue/trunk/src/waeup/aaue/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py

    r14057 r14150  
    8989    'jamb_reg_number',
    9090    'aggregate',
    91 
    92     'firstname',
    93     'middlename',
    94     'lastname',
    95     'sex',
    96     'lga',
    97     'course1',
    9891    'master_sheet_number',
    9992    'screening_venue',
     
    179172    )
    180173
     174UPDATE_OMIT_FIELDS = (
     175    'firstname',
     176    'middlename',
     177    'lastname',
     178    'sex',
     179    'lga',
     180    'course1',
     181    )
     182
    181183class CustomApplicantDisplayFormPage(NigeriaApplicantDisplayFormPage):
    182184    """A display view for applicant data.
     
    196198            for field in PG_OMIT_DISPLAY_FIELDS:
    197199                form_fields = form_fields.omit(field)
    198         elif self.target is not None and self.target in ('ptee', 'ude'):
     200        elif self.target is not None and self.target in ('ptee',):
    199201            for field in PTEE_OMIT_DISPLAY_FIELDS:
    200202                form_fields = form_fields.omit(field)
     
    258260            for field in PG_OMIT_PDF_FIELDS:
    259261                form_fields = form_fields.omit(field)
    260         elif self.target is not None and self.target in ('ptee', 'ude'):
     262        elif self.target is not None and self.target in ('ptee',):
    261263            for field in PTEE_OMIT_PDF_FIELDS:
    262264                form_fields = form_fields.omit(field)
     
    289291            for field in PG_OMIT_MANAGE_FIELDS:
    290292                form_fields = form_fields.omit(field)
    291         elif self.target is not None and self.target in ('ptee', 'ude'):
     293        elif self.target is not None and self.target in ('ptee',):
    292294            for field in PTEE_OMIT_MANAGE_FIELDS:
    293295                form_fields = form_fields.omit(field)
     
    340342            for field in PG_OMIT_EDIT_FIELDS:
    341343                form_fields = form_fields.omit(field)
    342         elif self.target is not None and self.target in ('ptee', 'ude'):
     344        elif self.target is not None and self.target in ('ptee',):
    343345            for field in PTEE_OMIT_EDIT_FIELDS:
    344346                form_fields = form_fields.omit(field)
     
    346348            for field in UG_OMIT_EDIT_FIELDS:
    347349                form_fields = form_fields.omit(field)
     350        # Additional omissions
     351        if self.target is not None and self.target in ('ude', 'utme'):
     352            for field in UPDATE_OMIT_FIELDS:
     353                form_fields[field].for_display = True
    348354        form_fields['applicant_id'].for_display = True
    349355        form_fields['reg_number'].for_display = True
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_browser.py

    r14027 r14150  
    6262        #self.browser.getControl(name="form.programme_type").value = ['regular']
    6363        self.browser.getControl(name="form.nationality").value = ['NG']
     64        self.browser.getControl(name="form.sex").value = ['m']
     65        self.browser.getControl(name="form.lastname").value = 'Merkel'
    6466        self.browser.getControl("Save").click()
    6567        self.browser.getControl("Add online payment ticket").click()
Note: See TracChangeset for help on using the changeset viewer.