Changeset 7057 for main/waeup.sirp/trunk/src/waeup/sirp/students/tests
- Timestamp:
- 9 Nov 2011, 12:34:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7056 r7057 27 27 import cStringIO 28 28 from datetime import datetime 29 import grok 30 from zope.event import notify 29 31 from zope.component import createObject 30 32 from zope.component.hooks import setSite, clearSite … … 927 929 self.browser.contents) 928 930 # Bed has been allocated 929 bed = self.app['hostels']['hall-1']['hall-1_A_101_A']930 self.assertTrue(bed .owner == self.student_id)931 bed1 = self.app['hostels']['hall-1']['hall-1_A_101_A'] 932 self.assertTrue(bed1.owner == self.student_id) 931 933 # BedTicketAddPage is now blocked 932 934 self.browser.getLink("Book accommodation").click() … … 940 942 self.assertMatches('...regular_male_fr...', self.browser.contents) 941 943 self.assertMatches('...%s...' % pin, self.browser.contents) 942 # Managers can relocate students 944 # Managers can relocate students if the student's bed_type has changed 943 945 self.browser.getLink("Relocate student").click() 944 946 self.assertMatches( … … 948 950 self.assertMatches( 949 951 "...Hall 1, Block A, Room 101, Bed B...", self.browser.contents) 950 bed1 = self.app['hostels']['hall-1']['hall-1_A_101_A']951 952 self.assertTrue(bed1.owner == NOT_OCCUPIED) 952 953 bed2 = self.app['hostels']['hall-1']['hall-1_A_101_B'] … … 958 959 payment = self.student['payments'][payment_id] 959 960 self.assertTrue(payment.p_item == u'regular_male_fr') 961 # Managers can relocate students if the bed's bed_type has changed 962 bed1.bed_type = u'regular_female_fr' 963 bed2.bed_type = u'regular_male_reserved' 964 notify(grok.ObjectModifiedEvent(bed1)) 965 notify(grok.ObjectModifiedEvent(bed2)) 966 self.browser.getLink("Relocate student").click() 967 self.assertMatches( 968 "...Student relocated and new bed booked...", self.browser.contents) 969 self.assertMatches( 970 "... Hall 1, Block A, Room 101, Bed A...", self.browser.contents) 971 self.assertMatches(bed1.owner, self.student_id) 972 self.assertMatches(bed2.owner, NOT_OCCUPIED) 960 973 # Managers can delete bed tickets 961 974 self.browser.open(self.acco_student_path) … … 965 978 self.browser.getControl("Remove selected", index=0).click() 966 979 self.assertMatches('...Successfully removed...', self.browser.contents) 967 # The bed has been released properlyby the event handler968 bed = self.app['hostels']['hall-1']['hall-1_A_101_A']969 self.assert True(bed.owner ==NOT_OCCUPIED)980 # The bed has been properly released by the event handler 981 self.assertMatches(bed1.owner, NOT_OCCUPIED) 982 self.assertMatches(bed2.owner, NOT_OCCUPIED) 970 983 return 971 984
Note: See TracChangeset for help on using the changeset viewer.