Ignore:
Timestamp:
10 Jun 2012, 08:59:49 (12 years ago)
Author:
Henrik Bettermann
Message:

Add expired property to be used in views and viewlets.

If strict_deadline is set, applicants are not allowed to open the edit form when application period has expired.

File:
1 edited

Legend:

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

    r8664 r8665  
    773773        self.assertTrue('Final Submit' in self.browser.contents)
    774774        self.fill_correct_values() # fill other fields with correct values
     775        self.browser.getControl("Save").click()
    775776        self.browser.getControl("Final Submit").click()
    776777        # We forgot to upload a passport picture
     
    789790            in self.browser.contents)
    790791        self.browser.getControl(name="confirm_passport").value = True
     792        # If application period has expired and strict-deadline is set
     793        # applicants do notsee edit button and can't open
     794        # the edit form.
    791795        self.applicantscontainer.enddate = datetime.now(pytz.utc)
    792         self.browser.getControl("Final Submit").click()
    793         self.assertTrue(
    794             'Application period has expired' in self.browser.contents)
     796        self.browser.open(self.view_path)
     797        self.assertFalse(
     798            'Edit application record' in self.browser.contents)
     799        self.browser.open(self.edit_path)
     800        self.assertTrue(
     801            'form is locked' in self.browser.contents)
    795802        # We can either postpone the enddate ...
    796803        self.applicantscontainer.enddate = datetime.now(
    797804            pytz.utc) + timedelta(days=10)
     805        self.browser.open(self.edit_path)
    798806        self.browser.getControl(name="confirm_passport").value = True
    799807        self.browser.getControl("Final Submit").click()
     
    811819        self.browser.goBack(count=1)
    812820        self.browser.getControl("Save").click()
     821        # The form is locked.
    813822        self.assertTrue(
    814823            'The requested form is locked' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.