Ignore:
Timestamp:
2 Apr 2014, 19:27:27 (11 years ago)
Author:
Henrik Bettermann
Message:

Adjust test.

File:
1 edited

Legend:

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

    r11535 r11568  
    620620            self.browser.headers['content-type'], 'image/jpeg')
    621621        self.assertEqual(len(self.browser.contents), 2787)
    622         # Reuploading a file which is bigger than 150k will raise an error
     622        # We can't reupload a file. The existing file must be deleted first.
    623623        self.browser.open(self.manage_clearance_path)
    624         # An image > 150K
     624        self.assertFalse(
     625            'upload_birthcertificateupload' in self.browser.contents)
     626        # File must be deleted first
     627        self.browser.getControl(name='delete_birthcertificateupload').click()
     628        self.assertTrue(
     629            'birth_certificate deleted' in self.browser.contents)
     630        # Uploading a file which is bigger than 150k will raise an error
    625631        big_image = StringIO(open(SAMPLE_IMAGE, 'rb').read() * 75)
    626632        ctrl = self.browser.getControl(name='birthcertificateupload')
     
    642648            # jpg file was recognized
    643649            'File birth_certificate.jpg uploaded.' in self.browser.contents)
     650        # Delete file again
     651        self.browser.getControl(name='delete_birthcertificateupload').click()
     652        self.assertTrue(
     653            'birth_certificate deleted' in self.browser.contents)
    644654        # File names must meet several conditions
    645655        bmp_image = open(SAMPLE_IMAGE_BMP, 'rb')
     
    651661        self.assertTrue('Only the following extensions are allowed'
    652662            in self.browser.contents)
    653         # Managers can delete files
    654         self.browser.getControl(name='delete_birthcertificateupload').click()
    655         self.assertTrue(
    656             'birth_certificate deleted' in self.browser.contents)
    657663
    658664        # Managers can upload a file via the StudentBaseManageFormPage
Note: See TracChangeset for help on using the changeset viewer.