Changeset 8664


Ignore:
Timestamp:
9 Jun 2012, 15:43:07 (12 years ago)
Author:
Henrik Bettermann
Message:

Use strict_deadline attribute.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r8636 r8664  
    964964            self.flash(_('The form cannot be submitted. Wrong state!'))
    965965            return
    966         if not self.context.__parent__.enddate or (
    967             self.context.__parent__.enddate < datetime.now(pytz.utc)):
     966        cond1 = self.context.__parent__.strict_deadline
     967        cond2 = self.context.__parent__.enddate
     968        cond3 = self.context.__parent__.enddate < datetime.now(pytz.utc)
     969        if cond1 and (not cond2 or cond3):
    968970            self.flash(
    969971                _('The form cannot be submitted. Application period has expired!'))
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r8643 r8664  
    9090        applicantscontainer.application_category = 'basic'
    9191        applicantscontainer.mode = 'create'
     92        applicantscontainer.strict_deadline = True
    9293        delta = timedelta(days=10)
    9394        applicantscontainer.startdate = datetime.now(pytz.utc) - delta
     
    792793        self.assertTrue(
    793794            'Application period has expired' in self.browser.contents)
     795        # We can either postpone the enddate ...
    794796        self.applicantscontainer.enddate = datetime.now(
    795797            pytz.utc) + timedelta(days=10)
     798        self.browser.getControl(name="confirm_passport").value = True
     799        self.browser.getControl("Final Submit").click()
     800        self.assertTrue(
     801            '... submitted ...' in self.browser.contents)
     802        # ... or allow submission after deadline.
     803        IWorkflowState(self.applicant).setState('paid')
     804        self.applicant.locked = False
     805        self.applicantscontainer.strict_deadline = False
     806        self.browser.open(self.edit_path)
    796807        self.browser.getControl(name="confirm_passport").value = True
    797808        self.browser.getControl("Final Submit").click()
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py

    r8645 r8664  
    6262        return None
    6363
    64     def getApplicantsStatistics(self,container):
     64    def getApplicantsStatistics(self, container):
    6565        state_stats = {INITIALIZED:0, STARTED:0, PAID:0, SUBMITTED:0,
    6666            ADMITTED:0, NOT_ADMITTED:0, CREATED:0}
Note: See TracChangeset for help on using the changeset viewer.