Changeset 7108 for main/waeup.sirp/trunk/src/waeup/sirp/students/tests
- Timestamp:
- 14 Nov 2011, 10:01:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7106 r7108 365 365 # as birth certificate 366 366 pseudo_image = StringIO('I pretend to be a graphics file') 367 ctrl = self.browser.getControl(name=' form.birth_certificate')367 ctrl = self.browser.getControl(name='birth_certificate') 368 368 file_ctrl = ctrl.mech_control 369 369 file_ctrl.add_file(pseudo_image, filename='myphoto.jpg') 370 self.browser.getControl("Save").click() # submit form 371 # Form has errors ... 372 self.assertTrue( 373 'Required input is missing' in self.browser.contents) 374 # ... but file has been uploaded and a correct <img> link included 375 self.assertTrue( 370 # The Save action does not upload files 371 self.browser.getControl("Save (no upload)").click() # submit form 372 self.assertFalse( 376 373 '<a target="image" href="birth_certificate.jpg">' in self.browser.contents) 374 # ... but the Upload submit button 375 import pdb; pdb.set_trace() 376 ctrl = self.browser.getControl(name='birth_certificate') 377 file_ctrl = ctrl.mech_control 378 file_ctrl.add_file(pseudo_image, filename='myphoto.jpg') 379 self.browser.getControl("Upload").click() # submit form 377 380 # There is a correct <img> link included 378 381 self.assertTrue( … … 388 391 photo_content = 'A' * 1024 * 151 # A string of 21 KB size 389 392 pseudo_image = StringIO(photo_content) 390 ctrl = self.browser.getControl(name=' form.birth_certificate')393 ctrl = self.browser.getControl(name='birth_certificate') 391 394 file_ctrl = ctrl.mech_control 392 395 file_ctrl.add_file(pseudo_image, filename='myphoto.jpg')
Note: See TracChangeset for help on using the changeset viewer.