Changeset 9736


Ignore:
Timestamp:
28 Nov 2012, 16:17:14 (12 years ago)
Author:
uli
Message:

Students catalog now supports current study level (requires site updates and reindexing).

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/catalog.py

    r9486 r9736  
    4646    faccode = index.Field(attribute='faccode')
    4747    current_session = index.Field(attribute='current_session')
     48    current_level = index.Field(attribute='current_level')
    4849    current_mode = index.Field(attribute='current_mode')
    4950
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_catalog.py

    r9647 r9736  
    4141        self.app['faculties'][facname][deptname] = Department(code=deptname)
    4242        cert = createObject('waeup.Certificate')
     43        cert.start_level = 100
     44        cert.end_level = 500
    4345        cert.code = certname
    4446        self.app['faculties'][facname][deptname].certificates.addCertificate(
     
    7072        self.student['studycourse'].certificate = self.certificate
    7173        self.student['studycourse'].current_session = 2010
     74        self.student['studycourse'].current_level = 100
    7275        # Update the students_catalog
    7376        notify(grok.ObjectModifiedEvent(self.student))
     
    143146        assert results[0] is self.app['students'][self.student_id]
    144147
     148    def test_search_by_level(self):
     149        # We can find a student in a certain level
     150        cat = queryUtility(ICatalog, name='students_catalog')
     151        results = cat.searchResults(current_level=(100, 100))
     152        results = [x for x in results] # Turn results generator into list
     153        assert len(results) == 1
     154        assert results[0] is self.app['students'][self.student_id]
     155        return
     156
    145157class CourseTicketCatalogTests(CatalogTestSetup):
    146158
Note: See TracChangeset for help on using the changeset viewer.