Changeset 7293


Ignore:
Timestamp:
6 Dec 2011, 19:54:38 (13 years ago)
Author:
Henrik Bettermann
Message:

Test student access with uploading a real jpeg passport file.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students/tests
Files:
1 added
1 edited

Legend:

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

    r7280 r7293  
    2323from StringIO import StringIO
    2424from datetime import datetime
     25import os
    2526import grok
    2627from zope.event import notify
     
    871872        # Student can upload a passport picture
    872873        self.browser.open(self.student_path + '/change_portrait')
    873         pseudo_image = StringIO('I pretend to be a graphics file')
    874874        ctrl = self.browser.getControl(name='passportuploadedit')
     875        file_obj = open(
     876            os.path.join(os.path.dirname(__file__), 'test_image.jpg'),'rb')
    875877        file_ctrl = ctrl.mech_control
    876         file_ctrl.add_file(pseudo_image, filename='my_photo.jpg')
     878        file_ctrl.add_file(file_obj, filename='my_photo.jpg')
    877879        self.browser.getControl(
    878880            name='upload_passportuploadedit').click()
Note: See TracChangeset for help on using the changeset viewer.