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/students/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.