Ignore:
Timestamp:
21 Dec 2011, 11:00:19 (13 years ago)
Author:
Henrik Bettermann
Message:

We have to ensure that students are properly indexed after creation from applicants.

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

Legend:

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

    r7420 r7421  
    2222from zope.component import getUtility, createObject, getUtility, getAdapter
    2323from zope.component.interfaces import IFactory
     24from zope.event import notify
    2425from zope.catalog.interfaces import ICatalog
    2526from zope.securitypolicy.interfaces import IPrincipalRoleManager
     
    114115        student['studycourse'].current_session = self.__parent__.year
    115116        self._copyPassportImage(student)
     117        # Update the catalog
     118        notify(grok.ObjectModifiedEvent(student))
    116119
    117120        # Save application slip
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_applicantcopier.py

    r7412 r7421  
    9191        self.assertEqual(self.browser.headers['Content-Type'],
    9292                         'application/pdf')
     93        # Has the student been properly indexed?
     94        # Yes, we can find the student in department
     95        self.browser.open('http://localhost/app/students')
     96        self.browser.getControl(name="searchtype").value = ['depcode']
     97        self.browser.getControl(name="searchterm").value = 'dep1'
     98        self.browser.getControl("Search").click()
     99        self.assertMatches('...John Tester...', self.browser.contents)
    93100
    94101    def test_copier_wo_passport(self):
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py

    r7408 r7421  
    9696        self.certificate = certificate
    9797        self.app['faculties']['fac1'] = Faculty()
    98         self.app['faculties']['fac1']['dep1'] = Department()
     98        # The code has explicitely to be set, otherwise we don't
     99        # find created students in their department
     100        self.app['faculties']['fac1']['dep1'] = Department(code='dep1')
    99101        self.department = self.app['faculties']['fac1']['dep1']
    100102        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
Note: See TracChangeset for help on using the changeset viewer.