Ignore:
Timestamp:
22 Oct 2012, 14:37:00 (12 years ago)
Author:
Henrik Bettermann
Message:

Switch to test environment and setup xmp split data (with constant school fee so far).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py

    r9370 r9387  
    1616## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    1717##
     18import grok
    1819from hurry.workflow.interfaces import IWorkflowState
     20from zope.component import createObject
     21from zope.event import notify
     22from waeup.kofa.university.faculty import Faculty
     23from waeup.kofa.university.department import Department
    1924from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    2025from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
     
    4651    def setUp(self):
    4752        super(InterswitchTestsStudents, self).setUp()
     53
     54        # Create at least one Kwarapoly faculty
     55        self.app['faculties']['CPGS'] = Faculty(code='CPGS')
     56        self.app['faculties']['CPGS']['dep1'] = Department(code='dep1')
     57        self.certificate2 = createObject('waeup.Certificate')
     58        self.certificate2.code = u'CERT2'
     59        self.certificate2.application_category = 'basic'
     60        self.certificate2.study_mode = 'nd_ft'
     61        self.certificate2.start_level = 100
     62        self.certificate2.end_level = 300
     63        self.app['faculties']['CPGS']['dep1'].certificates.addCertificate(
     64            self.certificate2)
     65        # Set study course attributes of test student
     66        self.student['studycourse'].certificate = self.certificate2
     67        self.student['studycourse'].current_session = 2004
     68        self.student['studycourse'].entry_session = 2004
     69        self.student['studycourse'].current_verdict = 'A'
     70        self.student['studycourse'].current_level = 100
     71        # Update the catalog
     72        notify(grok.ObjectModifiedEvent(self.student))
     73
    4874        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    4975        self.browser.open(self.payments_path)
     
    75101                           self.browser.contents)
    76102        self.assertMatches(
    77             '...<span>12495.0</span>...',
     103            '...<span>60980.0</span>...',
    78104            self.browser.contents)
    79105        self.payment_url = self.browser.url
     
    84110                           self.browser.contents)
    85111        self.assertMatches(
    86             '...<input type="hidden" name="amount" value="1249500.0" />...',
    87             self.browser.contents)
    88         self.assertMatches(
    89             '...item_name="schoolfee" item_amt="1044500" bank_id="117" acct_num="6216801033"...',
    90             self.browser.contents)
    91         self.assertMatches(
    92             '...item_name="KwaraPoly Split" item_amt="140000" bank_id="117" acct_num="6216801058"...',
    93             self.browser.contents)
    94         self.assertMatches(
    95             '...item_name="BT Education" item_amt="50000" bank_id="31" acct_num="0026781725"...',
     112            '...<input type="hidden" name="amount" value="6098000.0" />...',
     113            self.browser.contents)
     114        self.assertMatches(
     115            '...item_name="schoolfee" item_amt="5768000" bank_id="120" acct_num="1771180233"...',
     116            self.browser.contents)
     117        self.assertMatches(
     118            '...item_name="Dalash" item_amt="180000" bank_id="117" acct_num="1013196791"...',
     119            self.browser.contents)
     120        self.assertMatches(
     121            '...item_name="BT Education" item_amt="120000" bank_id="117" acct_num="1010764827"...',
    96122            self.browser.contents)
    97123
Note: See TracChangeset for help on using the changeset viewer.