Changeset 16456 for main/waeup.uniben/trunk/src
- Timestamp:
- 13 Apr 2021, 10:32:16 (4 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r16452 r16456 146 146 def dataNotComplete(self): 147 147 store = getUtility(IExtFileStore) 148 if not store.getFileByContext(self.context, attr=u'passport.jpg'): 149 return _('No red background passport picture uploaded.') 148 150 if not store.getFileByContext(self.context, attr=u'birth_certificate.jpg'): 149 151 return _('No birth certificate uploaded.') … … 780 782 emit_lock_message(self) 781 783 return 782 # Passport pictures must not be editable if application slip783 # exists.784 784 slip = getUtility(IExtFileStore).getFileByContext( 785 785 self.context, 'application_slip') 786 786 PORTRAIT_CHANGE_STATES = getUtility(IStudentsUtils).PORTRAIT_CHANGE_STATES 787 if self.context.state not in PORTRAIT_CHANGE_STATES or slip is not None:787 if self.context.state not in PORTRAIT_CHANGE_STATES: 788 788 emit_lock_message(self) 789 789 return -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r16447 r16456 45 45 46 46 SAMPLE_FPM = os.path.join(os.path.dirname(__file__), 'sample.fpm') 47 SAMPLE_ IMAGE= os.path.join(os.path.dirname(__file__), 'test_image.jpg')47 SAMPLE_PASSPORT = os.path.join(os.path.dirname(__file__), 'test_image.jpg') 48 48 49 49 class OfficerUITests(StudentsFullSetup): … … 157 157 # have been uploaded. 158 158 self.browser.getControl("Save and request clearance").click() 159 160 self.assertTrue('No red background passport picture uploaded' 161 in self.browser.contents) 162 passport = 'My passport picture' 163 file_id = IFileStoreNameChooser(self.student).chooseName( 164 attr="passport.jpg") 165 image = open(SAMPLE_PASSPORT, 'rb') 166 file_store.createFile(file_id, image) 167 self.browser.open(self.edit_clearance_path) 168 self.browser.getControl("Save and request clearance").click() 169 159 170 self.assertTrue('No birth certificate uploaded' 160 171 in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.