Hi Darryl > I have found a strange behaviour with testbrowser and file > objects. What appears to happen is that the > cStringIO.StringIO that I pass to the file control in a form > is converted to unicode before reaching the view handler. > This then raises AttibuteError: Unicode has no read attribute.
[...] Try something like that: >>> import StringIO >>> myPhoto = StringIO.StringIO('my photo') >>> control = user.getControl(name='photoForm.photo') >>> fileControl = control.mech_control >>> fileControl.add_file(myPhoto, filename='myPhoto.gif') >>> user.getControl(name='photoForm.actions.add').click() >>> imgTag = 'src="http://localhost/++skin++Application/000001/0001/1/photo"' >>> imgTag in user.contents True Regards Roger Ineichen _____________________________ END OF MESSAGE > Best regards, > Darryl Cousins _______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users