Changeset 15351


Ignore:
Timestamp:
11 Mar 2019, 20:43:33 (6 years ago)
Author:
Henrik Bettermann
Message:

Add lga to NigeriaDataForBursaryExporter?.

Adjust tests.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py

    r15270 r15351  
    204204            in self.browser.contents)
    205205        self.assertTrue(
    206             'action="http://www.remitademo.net/remita/ecomm/finalize.reg"'
     206            'action="https://www.remitademo.net/remita/ecomm/finalize.reg"'
    207207            in self.browser.contents)
    208208        self.assertEqual(self.payment.r_company, 'remita')
     
    235235        self.payment.p_id = self.orderId
    236236        self.browser.getLink("Requery Remita Payment Status").click()
    237         self.assertTrue('Successful payment' in self.browser.contents)
     237        self.assertTrue('Payment successfully completed' in self.browser.contents)
    238238        self.assertEqual(self.payment.r_desc, 'Approved')
    239239        self.assertEqual(self.payment.r_amount_approved , 1000.0)
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/webservices.py

    r14801 r15351  
    3838    merchantId = '2547916'
    3939    host = 'www.remitademo.net'
    40     https = False
     40    https = True
    4141    api_key = '1946'
    4242
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/export.py

    r13944 r15351  
    9696            'state','current_session',
    9797            'entry_session', 'entry_mode',
    98             'faccode', 'depcode','certcode')
     98            'faccode', 'depcode','certcode','lga')
     99
     100    def mangle_value(self, value, name, context=None):
     101        """The mangler fetches the student data.
     102        """
     103        if context is not None:
     104            student = context.student
     105            if name in [
     106                'student_id','matric_number', 'reg_number',
     107                'firstname', 'middlename', 'lastname',
     108                'state', 'current_session',
     109                'entry_session', 'entry_mode',
     110                'faccode', 'depcode', 'certcode',
     111                'lga'] and student is not None:
     112                value = getattr(student, name, None)
     113        return super(
     114            StudentPaymentExporter, self).mangle_value(
     115            value, name, context=context)
    99116
    100117class ClearanceRequestedStudentExporter(StudentExporter):
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py

    r14274 r15351  
    3737from waeup.kofa.students.interfaces import IStudentsUtils
    3838from waeup.kofa.browser.tests.test_pdf import samples_dir
     39from waeup.kofa.tests.test_authentication import SECRET
    3940from kofacustom.nigeria.students.batching import NigeriaStudentProcessor
    4041from kofacustom.nigeria.testing import FunctionalLayer
     
    352353
    353354    def test_financial_clearance(self):
    354         self.app['users'].addUser('mrbursary', 'mrbursarysecret')
     355        self.app['users'].addUser('mrbursary', SECRET)
    355356        self.app['users']['mrbursary'].email = 'mrbursary@foo.ng'
    356357        self.app['users']['mrbursary'].title = u'Carlo Pitter'
     
    367368        self.browser.open(self.login_path)
    368369        self.browser.getControl(name="form.login").value = 'mrbursary'
    369         self.browser.getControl(name="form.password").value = 'mrbursarysecret'
     370        self.browser.getControl(name="form.password").value = SECRET
    370371        self.browser.getControl("Login").click()
    371372        # BO can see his roles
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_export.py

    r15045 r15351  
    2626from kofacustom.nigeria.students.export import (
    2727    NigeriaStudentExporter, NigeriaStudentPaymentExporter,
    28     ClearanceRequestedStudentExporter)
     28    ClearanceRequestedStudentExporter, NigeriaDataForBursaryExporter)
    2929from kofacustom.nigeria.testing import FunctionalLayer
    3030
     
    168168            )
    169169        return
     170
     171class BursaryDataExporterTest(StudentImportExportSetup):
     172
     173    layer = FunctionalLayer
     174
     175    def setUp(self):
     176        super(BursaryDataExporterTest, self).setUp()
     177        self.setup_for_export()
     178        return
     179
     180    def test_export_all(self):
     181        # we can really export all payments
     182        # set values we can expect in export file
     183        self.setup_student(self.student)
     184        exporter = NigeriaDataForBursaryExporter()
     185        exporter.export_all(self.app, self.outfile)
     186        result = open(self.outfile, 'rb').read()
     187        self.assertEqual(
     188            result,
     189            'ac,amount_auth,creation_date,formatted_p_date,gateway_amt,'
     190            'p_category,p_current,p_id,p_item,p_level,p_session,p_state,'
     191            'payment_date,provider_amt,r_amount_approved,r_card_num,r_code,'
     192            'r_company,r_desc,r_pay_reference,thirdparty_amt,student_id,'
     193            'matric_number,reg_number,firstname,middlename,lastname,state,'
     194            'current_session,entry_session,entry_mode,faccode,depcode,certcode,lga\r\n'
     195
     196            '666,12.12,%s-04-01 13:12:01#,,,schoolfee,1,my-id,p-item,'
     197            '100,%s,paid,%s-04-01 14:12:01#,,12.12,,r-code,,,,,A111111,'
     198            '234,123,Anna,M.,Tester,created,2012,2010,ug_ft,NA,NA,CERT1,\r\n'
     199            % (curr_year-6, curr_year-6, curr_year-6)
     200            )
     201        return
Note: See TracChangeset for help on using the changeset viewer.