Changeset 7068 for main/waeup.sirp/trunk/src/waeup/sirp/students/tests
- Timestamp:
- 10 Nov 2011, 18:56:18 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7061 r7068 961 961 self.browser.getLink("Relocate student").click() 962 962 self.assertMatches( 963 "... Bed category hasn't changed...", self.browser.contents)963 "...Student can't be relocated...", self.browser.contents) 964 964 self.student.sex = u'f' 965 965 self.browser.getLink("Relocate student").click() … … 977 977 # Managers can relocate students if the bed's bed_type has changed 978 978 bed1.bed_type = u'regular_female_fr' 979 bed2.bed_type = u'regular_male_ reserved'979 bed2.bed_type = u'regular_male_fr' 980 980 notify(grok.ObjectModifiedEvent(bed1)) 981 981 notify(grok.ObjectModifiedEvent(bed2)) 982 982 self.browser.getLink("Relocate student").click() 983 983 self.assertMatches( 984 "...Student relocated and new bed booked...", self.browser.contents)984 "...Student relocated...", self.browser.contents) 985 985 self.assertMatches( 986 986 "... Hall 1, Block A, Room 101, Bed A...", self.browser.contents) 987 987 self.assertMatches(bed1.owner, self.student_id) 988 988 self.assertMatches(bed2.owner, NOT_OCCUPIED) 989 # Managers can delete bed tickets 989 # Managers can't relocate students if bed is reserved 990 self.student.sex = u'm' 991 bed1.bed_type = u'regular_female_reserved' 992 notify(grok.ObjectModifiedEvent(bed1)) 993 self.browser.getLink("Relocate student").click() 994 self.assertMatches( 995 "...Students in reserved beds can't be relocated...", 996 self.browser.contents) 997 # Managers can relocate students if booking has been cancelled but 998 # other bed space has been manually allocated after cancellation 999 old_owner = bed1.releaseBed() 1000 self.assertMatches(old_owner, self.student_id) 1001 bed2.owner = self.student_id 1002 self.browser.open(self.acco_student_path + '/2004') 1003 self.assertMatches( 1004 "...booking cancelled...", self.browser.contents) 1005 self.browser.getLink("Relocate student").click() 1006 # We didn't informed the catalog therefore the new owner is not found 1007 self.assertMatches( 1008 "...There is no free bed in your category regular_male_fr...", 1009 self.browser.contents) 1010 # Now we fire the event properly 1011 notify(grok.ObjectModifiedEvent(bed2)) 1012 self.browser.getLink("Relocate student").click() 1013 self.assertMatches( 1014 "...Student relocated...", self.browser.contents) 1015 self.assertMatches( 1016 "... Hall 1, Block A, Room 101, Bed B...", self.browser.contents) 1017 # Managers can delete bed tickets 990 1018 self.browser.open(self.acco_student_path) 991 1019 ctrl = self.browser.getControl(name='val_id')
Note: See TracChangeset for help on using the changeset viewer.