Changeset 10828 for main/waeup.fceokene


Ignore:
Timestamp:
9 Dec 2013, 09:39:27 (11 years ago)
Author:
Henrik Bettermann
Message:

Customize AdmissionSlipActionButton?.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r10664 r10828  
    230230        self.assertEqual(payment.p_level, 100)
    231231        self.assertEqual(payment.p_session, 2004)
    232         self.assertEqual(payment.amount_auth, 13246.0)
     232        self.assertEqual(payment.amount_auth, 13245.0)
    233233        self.assertEqual(payment.p_item, u'CERT1')
    234234        self.assertEqual(error, None)
     
    376376            in self.browser.contents)
    377377        return
     378
     379    def test_admission_slip_link(self):
     380        # Login
     381        IWorkflowState(self.student).setState('admitted')
     382        self.browser.open(self.login_path)
     383        self.browser.getControl(name="form.login").value = self.student_id
     384        self.browser.getControl(name="form.password").value = 'spwd'
     385        self.browser.getControl("Login").click()
     386        self.assertFalse(
     387          'Download admission letter' in self.browser.contents)
     388        IWorkflowState(self.student).setState('clearance started')
     389        self.browser.open(self.student_path)
     390        self.assertTrue(
     391          'Download admission letter' in self.browser.contents)
     392        return
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/viewlets.py

    r9871 r10828  
    1818
    1919from waeup.kofa.students.viewlets import (
     20    AdmissionSlipActionButton,
    2021    AddPreviousPaymentActionButton, AddBalancePaymentActionButton)
     22from waeup.kofa.students.workflow import ADMITTED
     23
     24class AdmissionSlipActionButton(AdmissionSlipActionButton):
     25
     26    @property
     27    def target_url(self):
     28        if self.context.state in (ADMITTED,):
     29            return ''
     30        return self.view.url(self.view.context, self.target)
    2131
    2232class AddPreviousPaymentActionButton(AddPreviousPaymentActionButton):
Note: See TracChangeset for help on using the changeset viewer.