Changeset 8981


Ignore:
Timestamp:
12 Jul 2012, 08:53:27 (12 years ago)
Author:
Henrik Bettermann
Message:

Merged with waeup.fceokene 8978:8979.

Location:
main/waeup.futminna/trunk/src/waeup/futminna
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna

  • main/waeup.futminna/trunk/src/waeup/futminna/applicants/interfaces.py

    r8932 r8981  
    3333    INigeriaUGApplicant, INigeriaPGApplicant,
    3434    INigeriaApplicantOnlinePayment,
     35    INigeriaUGApplicantEdit, INigeriaPGApplicantEdit,
     36    INigeriaApplicantUpdateByRegNo,
     37    IPUTMEApplicantEdit,
    3538    UG_OMIT_DISPLAY_FIELDS,
    3639    UG_OMIT_PDF_FIELDS,
     
    8285        """
    8386
    84 class ICustomUGApplicantEdit(ICustomUGApplicant):
     87class ICustomUGApplicantEdit(INigeriaUGApplicantEdit):
    8588    """An undergraduate applicant interface for edit forms.
    8689
     
    9497    """
    9598
    96     email = schema.ASCIILine(
    97         title = _(u'Email Address'),
    98         required = True,
    99         constraint=validate_email,
    100         )
    101     date_of_birth = FormattedDate(
    102         title = _(u'Date of Birth'),
    103         required = True,
    104         show_year = True,
    105         )
    106 
    107 ICustomUGApplicantEdit[
    108     'date_of_birth'].order =  ICustomUGApplicant['date_of_birth'].order
    109 ICustomUGApplicantEdit[
    110     'email'].order =  ICustomUGApplicant['email'].order
    111 
    112 class ICustomPGApplicantEdit(ICustomPGApplicant):
     99class ICustomPGApplicantEdit(INigeriaPGApplicantEdit):
    113100    """A postgraduate applicant interface for editing.
    114101
     
    122109    """
    123110
    124     email = schema.ASCIILine(
    125         title = _(u'Email Address'),
    126         required = True,
    127         constraint=validate_email,
    128         )
    129     date_of_birth = FormattedDate(
    130         title = _(u'Date of Birth'),
    131         required = True,
    132         show_year = True,
    133         )
    134 
    135 ICustomPGApplicantEdit[
    136     'date_of_birth'].order =  ICustomPGApplicant['date_of_birth'].order
    137 ICustomPGApplicantEdit[
    138     'email'].order =  ICustomPGApplicant['email'].order
    139 
    140111class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
    141112    """An applicant payment via payment gateways.
     
    143114    """
    144115
    145 class IPUTMEApplicantEdit(ICustomUGApplicant):
     116class IPUTMEApplicantEdit(IPUTMEApplicantEdit):
    146117    """An undergraduate applicant interface for editing.
    147118
     
    154125    respective form page.
    155126    """
    156     email = schema.ASCIILine(
    157         title = _(u'Email Address'),
    158         required = True,
    159         constraint=validate_email,
    160         )
    161     date_of_birth = FormattedDate(
    162         title = _(u'Date of Birth'),
    163         required = True,
    164         show_year = True,
    165         )
    166127
    167 IPUTMEApplicantEdit[
    168     'date_of_birth'].order =  ICustomUGApplicant['date_of_birth'].order
    169 IPUTMEApplicantEdit[
    170     'email'].order =  ICustomUGApplicant['email'].order
    171 
    172 class ICustomApplicantUpdateByRegNo(ICustomApplicant):
     128class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo):
    173129    """Representation of an applicant.
    174130
     
    176132    the applicant object.
    177133    """
    178     reg_number = schema.TextLine(
    179         title = u'Registration Number',
    180         required = False,
    181         )
     134
  • main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py

    r8907 r8981  
    152152        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    153153        self.browser.getControl("Create ticket").click()
     154        self.assertMatches('...Session configuration object is not...',
     155                           self.browser.contents)
     156        # Uups, we forgot to add a session configuration for next session
     157        configuration = createObject('waeup.SessionConfiguration')
     158        configuration.academic_session = 2005
     159        self.app['configuration'].addSessionConfiguration(configuration)
     160        self.browser.open(self.payments_path + '/addop')
     161        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     162        self.browser.getControl("Create ticket").click()
    154163        self.assertMatches('...ticket created...',
    155164                           self.browser.contents)
     
    188197        utils = getUtility(IStudentsUtils)
    189198
     199        configuration = createObject('waeup.SessionConfiguration')
     200        configuration.academic_session = 2005
     201        self.app['configuration'].addSessionConfiguration(configuration)
     202
    190203        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    191204        self.assertEqual(payment, None)
     
    200213        self.assertEqual(error, None)
    201214
    202         # Add penalty fee.
     215        # Add penalty fee ...
     216        # ... for cleared
    203217        self.app['configuration']['2004'].penalty_ug = 99.0
     218        # ... for returning
     219        self.app['configuration']['2005'].penalty_ug = 88.0
    204220        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    205221        self.assertEqual(payment.amount_auth, 40099.0)
     
    209225        self.assertEqual(payment.p_level, 200)
    210226        self.assertEqual(payment.p_session, 2005)
    211         self.assertEqual(payment.amount_auth, 20099.0)
     227        self.assertEqual(payment.amount_auth, 20088.0)
    212228        self.assertEqual(payment.p_item, u'CERT1')
    213229        self.assertEqual(error, None)
  • main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py

    r8952 r8981  
    9797                p_session, p_level = self.getReturningData(student)
    9898                amount = getattr(certificate, 'school_fee_2', 0.0)
     99                try:
     100                    academic_session = grok.getSite()[
     101                        'configuration'][str(p_session)]
     102                except KeyError:
     103                    return _(u'Session configuration object is not available.'), None
    99104            elif student.is_postgrad and student.state == PAID:
    100105                # Returning postgraduate students also pay for the next session
     
    102107                p_session += 1
    103108                amount = getattr(certificate, 'school_fee_2', 0.0)
     109                try:
     110                    academic_session = grok.getSite()[
     111                        'configuration'][str(p_session)]
     112                except KeyError:
     113                    return _(u'Session configuration object is not available.'), None
    104114        if amount in (0.0, None):
    105115            return _(u'Amount could not be determined.'), None
Note: See TracChangeset for help on using the changeset viewer.