Ignore:
Timestamp:
2 Oct 2012, 16:50:57 (12 years ago)
Author:
Henrik Bettermann
Message:

Add special permission and view for triggering transitions

File:
1 edited

Legend:

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

    r9257 r9273  
    113113        self.student_path = self.container_path + '/' + self.student_id
    114114        self.manage_student_path = self.student_path + '/manage_base'
     115        self.trigtrans_path = self.student_path + '/trigtrans'
    115116        self.clearance_path = self.student_path + '/view_clearance'
    116117        self.personal_path = self.student_path + '/view_personal'
     
    435436        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    436437        self.assertEqual(self.browser.url, self.student_path)
     438        self.browser.getLink("Trigger").click()
     439        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     440        # Managers can trigger transitions
     441        self.browser.getControl(name="transition").value = ['admit']
     442        self.browser.getControl("Save").click()
     443        # Managers can edit base
     444        self.browser.open(self.student_path)
    437445        self.browser.getLink("Manage").click()
    438         self.assertEqual(self.browser.headers['Status'], '200 Ok')
    439446        self.assertEqual(self.browser.url, self.manage_student_path)
    440         # Managers can edit base data and fire transitions
    441         self.browser.getControl(name="transition").value = ['admit']
     447        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    442448        self.browser.getControl(name="form.firstname").value = 'John'
    443449        self.browser.getControl(name="form.lastname").value = 'Tester'
     
    720726        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    721727        student = self.app['students'][self.student_id]
    722         self.browser.open(self.manage_student_path)
     728        self.browser.open(self.trigtrans_path)
    723729        self.assertTrue(student.clearance_locked)
    724730        self.browser.getControl(name="transition").value = ['admit']
     
    761767        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    762768        student = self.app['students'][self.student_id]
    763         self.browser.open(self.manage_student_path)
     769        self.browser.open(self.trigtrans_path)
    764770        self.assertTrue('<option value="reset6">' in self.browser.contents)
    765771        self.assertTrue('<option value="register_courses">' in self.browser.contents)
    766772        self.assertTrue('<option value="reset5">' in self.browser.contents)
    767773        self.certificate.study_mode = 'pg_ft'
    768         self.browser.open(self.manage_student_path)
     774        self.browser.open(self.trigtrans_path)
    769775        self.assertFalse('<option value="reset6">' in self.browser.contents)
    770776        self.assertFalse('<option value="register_courses">' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.