Changeset 9416
- Timestamp:
- 25 Oct 2012, 11:41:19 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/hostels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
r9414 r9416 360 360 @action(_('Save')) 361 361 def save(self, **data): 362 if data['owner'] == NOT_OCCUPIED: 363 self.flash(_('No valid student id.')) 364 self.redirect(self.url(self.context)) 365 return 362 366 msave(self, **data) 363 367 self.redirect(self.url(self.context.__parent__, '@@manage')+'?tab2') -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
r9414 r9416 236 236 owner = schema.TextLine( 237 237 title = _(u'Owner (Student)'), 238 description = _('Enter valid student id.'), 238 239 required = True, 239 240 default = u'', … … 251 252 if not bed.owner in student_ids: 252 253 raise Invalid(_( 253 "Either student does not exist or is not in accommodation session.")) 254 "Either student does not exist or student " 255 "is not in accommodation session.")) 254 256 catalog = getUtility(ICatalog, name='beds_catalog') 255 257 beds = catalog.searchResults(owner=(bed.owner,bed.owner)) -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
r9414 r9416 315 315 # Managers can manually allocate eligible students after cancellation 316 316 self.browser.open(self.container_path + '/hall-1/hall-1_A_101_A') 317 # 'not occupied' is not accepted 318 self.browser.getControl("Save").click() 319 self.assertMatches( 320 "...No valid student id...", 321 self.browser.contents) 322 # Invalid student ids are not accepted 317 323 self.browser.getControl(name="form.owner").value = 'nonsense' 318 324 self.browser.getControl("Save").click() 319 325 self.assertMatches( 320 "...Either student does not exist or is not in accommodation session...", 326 "...Either student does not exist or student " 327 "is not in accommodation session...", 321 328 self.browser.contents) 322 329 self.browser.getControl(name="form.owner").value = self.student_id
Note: See TracChangeset for help on using the changeset viewer.