Changeset 13460 for main/waeup.uniben/trunk/src/waeup/uniben
- Timestamp:
- 16 Nov 2015, 09:10:31 (9 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/tests/test_browser.py
r13317 r13460 944 944 # ... but not if booking period has expired ... 945 945 self.app['hostels'].enddate = datetime.now(pytz.utc) 946 self.browser.get Link("Book accommodation").click()946 self.browser.getControl("Book accommodation").click() 947 947 self.assertMatches('...Outside booking period: ...', 948 948 self.browser.contents) … … 950 950 # ... or student data are incomplete ... 951 951 self.student['studycourse'].current_level = None 952 self.browser.get Link("Book accommodation").click()952 self.browser.getControl("Book accommodation").click() 953 953 self.assertMatches('...Your data are incomplete...', 954 954 self.browser.contents) 955 955 self.student['studycourse'].current_level = 200 956 956 # ... or student is not the an allowed state ... 957 self.browser.get Link("Book accommodation").click()957 self.browser.getControl("Book accommodation").click() 958 958 self.assertMatches('...You are in the wrong...', 959 959 self.browser.contents) … … 964 964 self.student['studycourse'].current_level = 500 # final-year 965 965 self.student['studycourse'].current_verdict = 'C' 966 self.browser.get Link("Book accommodation").click()966 self.browser.getControl("Book accommodation").click() 967 967 self.assertMatches('...Your are not eligible...', 968 968 self.browser.contents) 969 969 self.student['studycourse'].previous_verdict = 'A' 970 self.browser.get Link("Book accommodation").click()970 self.browser.getControl("Book accommodation").click() 971 971 self.assertMatches('...Activation Code:...', 972 972 self.browser.contents) … … 996 996 self.assertTrue(bed.owner == self.student_id) 997 997 # BedTicketAddPage is now blocked. 998 self.browser.get Link("Book accommodation").click()998 self.browser.getControl("Book accommodation").click() 999 999 self.assertMatches('...You already booked a bed space...', 1000 1000 self.browser.contents) -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r13450 r13460 388 388 return None 389 389 390 def selectBed(self, available_beds):391 """Select a bed from a list of available beds.392 Beds are sorted by the sort id of the hostel and the bed number.393 The first bed found in this sorted list is taken.394 """395 sorted_beds = sorted(available_beds,396 key=lambda bed: 1000 * bed.__parent__.sort_id + bed.bed_number)397 return sorted_beds[0]398 399 390 # Uniben prefix 400 391 STUDENT_ID_PREFIX = u'B'
Note: See TracChangeset for help on using the changeset viewer.