Changeset 7015 for main/waeup.sirp/trunk/src/waeup/sirp/students/tests
- Timestamp:
- 7 Nov 2011, 07:43:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7009 r7015 161 161 self.app['configuration'].addSessionConfiguration(configuration) 162 162 163 # Create a hostel with bed163 # Create a hostel with two beds 164 164 hostel = Hostel() 165 165 hostel.hostel_id = u'hall-1' … … 171 171 bed.owner = NOT_OCCUPIED 172 172 bed.bed_type = u'regular_male_fr' 173 self.app['hostels'][hostel.hostel_id].addBed(bed) 174 bed = Bed() 175 bed.bed_id = u'hall-1_A_101_B' 176 bed.bed_number = 2 177 bed.owner = NOT_OCCUPIED 178 bed.bed_type = u'regular_female_fr' 173 179 self.app['hostels'][hostel.hostel_id].addBed(bed) 174 180 … … 834 840 self.assertMatches('...Course registration has been started...', 835 841 self.browser.contents) 836 self.assertTrue(self.student.state ,'school fee paid')842 self.assertTrue(self.student.state == 'school fee paid') 837 843 return 838 844 … … 858 864 # Managers can use HOS code and book a bed space with it 859 865 self.browser.open(self.acco_student_path) 860 self.browser.get Control("Book accommodation").click()861 self.assertMatches('... Wrong state...',866 self.browser.getLink("Book accommodation").click() 867 self.assertMatches('...You are in the wrong...', 862 868 self.browser.contents) 863 869 IWorkflowInfo(self.student).fireTransition('admit') 864 self.browser.get Control("Book accommodation").click()870 self.browser.getLink("Book accommodation").click() 865 871 self.assertMatches('...Activation Code:...', 866 872 self.browser.contents) … … 872 878 # Bed has been allocated 873 879 bed = self.app['hostels']['hall-1']['hall-1_A_101_A'] 874 self.assertTrue(bed.owner ,self.student_id)880 self.assertTrue(bed.owner == self.student_id) 875 881 # BedTicketAddPage is now blocked 876 self.browser.get Control("Book accommodation").click()877 self.assertMatches('... Ticket for 2004 already created...',882 self.browser.getLink("Book accommodation").click() 883 self.assertMatches('...You already booked a bed space...', 878 884 self.browser.contents) 879 885 # The bed ticket displays the data correctly … … 884 890 self.assertMatches('...regular_male_fr...', self.browser.contents) 885 891 self.assertMatches('...%s...' % pin, self.browser.contents) 886 # Managers cab delete bed tickets 892 # Managers can relocate students 893 self.browser.getLink("Relocate student").click() 894 self.assertMatches( 895 "...Bed category hasn't changed...", self.browser.contents) 896 self.student.sex = u'f' 897 self.browser.getLink("Relocate student").click() 898 self.assertMatches( 899 "...Hall 1, Block A, Room 101, Bed B...", self.browser.contents) 900 bed1 = self.app['hostels']['hall-1']['hall-1_A_101_A'] 901 self.assertTrue(bed1.owner == NOT_OCCUPIED) 902 bed2 = self.app['hostels']['hall-1']['hall-1_A_101_B'] 903 self.assertTrue(bed2.owner == self.student_id) 904 # Managers can delete bed tickets 887 905 self.browser.open(self.acco_student_path) 888 906 ctrl = self.browser.getControl(name='val_id')
Note: See TracChangeset for help on using the changeset viewer.