Ignore:
Timestamp:
14 Jun 2012, 08:08:27 (13 years ago)
Author:
Henrik Bettermann
Message:

Merged with r8720.

Location:
main/waeup.aaue/trunk/src/waeup/aaue
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue

  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r8677 r8723  
    1919import shutil
    2020import tempfile
     21from StringIO import StringIO
    2122from hurry.workflow.interfaces import IWorkflowState
    2223from zope.component.hooks import setSite, clearSite
     
    2627from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    2728from waeup.kofa.testing import FunctionalTestCase
     29from waeup.kofa.interfaces import (
     30    IExtFileStore, IFileStoreNameChooser)
    2831from waeup.kofa.students.batching import StudentProcessor
    2932from waeup.kofa.students.interfaces import IStudentsUtils
     
    287290        self.browser.getControl(name="form.password").value = 'spwd'
    288291        self.browser.getControl("Login").click()
     292        # Even in state admitted students can't change the portait if
     293        # application slip exists.
     294        IWorkflowState(self.student).setState('admitted')
     295        self.browser.open(self.student_path)
     296        self.assertTrue('Change portrait' in self.browser.contents)
     297        file_store = getUtility(IExtFileStore)
     298        applicant_slip = 'My application slip'
     299        file_id = IFileStoreNameChooser(self.student).chooseName(
     300            attr="application_slip.pdf")
     301        file_store.createFile(file_id, StringIO(applicant_slip))
     302        self.browser.open(self.student_path)
     303        self.assertFalse('Change portrait' in self.browser.contents)
     304        self.browser.open(self.student_path + '/change_portrait')
     305        self.assertTrue('The requested form is locked' in self.browser.contents)
    289306        # Student can view and edit clearance data
    290307        self.browser.getLink("Clearance Data").click()
Note: See TracChangeset for help on using the changeset viewer.