Ignore:
Timestamp:
22 Dec 2011, 07:39:00 (13 years ago)
Author:
Henrik Bettermann
Message:

The result list instance has to be created before concatenating with [curr_course,]. Now all tests pass.

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

Legend:

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

    r7433 r7434  
    738738        self.assertTrue(
    739739            'Unnamed Certificate' in self.browser.contents)
     740        # Even if we add a new certificate the previous (removed)
     741        # certificate is shown
     742        certificate = createObject('waeup.Certificate')
     743        certificate.code = 'CERT2'
     744        certificate.title = 'New Certificate'
     745        certificate.application_category = 'basic'
     746        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
     747            certificate)
     748        self.browser.open(self.edit_path)
     749        self.assertTrue(
     750            '<option selected="selected" value="CERT1">' in self.browser.contents)
    740751
    741752class ApplicantRegisterTests(ApplicantsFullSetup):
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/vocabularies.py

    r7350 r7434  
    5858        result = catalog.searchResults(
    5959            application_category=(appcat,appcat))
     60        result = sorted(result, key=lambda value: value.code)
    6061        curr_course = context.course1
    6162        if curr_course is not None and curr_course not in result:
     
    6364            # (any more)
    6465            result = [curr_course,] + result
    65         return sorted(result, key=lambda value: value.code)
     66        return result
Note: See TracChangeset for help on using the changeset viewer.