Ignore:
Timestamp:
23 May 2013, 20:55:30 (12 years ago)
Author:
Henrik Bettermann
Message:

Make sure that that 1st and 2nd choice course of study are different.

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

Legend:

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

    r10101 r10210  
    993993            # Error during image upload. Ignore other values.
    994994            return
     995        if data['course1'] == data['course2']:
     996            self.flash(_('1st and 2nd choice must be different.'))
     997            return
    995998        self.applyData(self.context, **data)
    996         self.flash('Form has been saved.')
     999        self.flash(_('Form has been saved.'))
    9971000        return
    9981001
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r10147 r10210  
    863863            % (self.applicant.applicant_id, payment.p_id)
    864864            in logcontent)
     865        return
     866
     867    def test_duplicate_choice(self):
     868        # Make sure that that 1st and 2nd choice are different
     869        self.login()
     870        self.browser.open(self.edit_path)
     871        self.fill_correct_values() # fill other fields with correct values
     872        self.browser.getControl(name="form.course2").value = ['CERT1']
     873        self.browser.getControl("Save").click()
     874        self.assertTrue(
     875            '1st and 2nd choice must be different' in self.browser.contents)
     876        self.browser.getControl(name="form.course2").value = []
     877        self.browser.getControl("Save").click()
     878        self.assertTrue('Form has been saved' in self.browser.contents)
    865879        return
    866880
Note: See TracChangeset for help on using the changeset viewer.