Changeset 6652 for main/waeup.sirp/trunk/src/waeup/sirp/students/tests
- Timestamp:
- 29 Aug 2011, 12:28:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6649 r6652 71 71 setSite(app) 72 72 73 74 73 # Add student with subobjects (done by addStudent) 75 74 student = Student() 76 75 student.name = u'Anna Tester' 77 student.student_id = u'Z654321' 78 self.app['students'].addStudent(student) 76 self.test_student_id = self.app['students'].addStudent(student) 79 77 80 78 self.container_path = 'http://localhost/app/students' 81 79 self.manage_container_path = self.container_path + '/@@manage' 82 80 self.add_student_path = self.container_path + '/addstudent' 83 self.student_path = self.container_path + '/ Z654321'81 self.student_path = self.container_path + '/' + self.test_student_id 84 82 self.manage_student_path = self.student_path + '/edit_base' 85 83 self.clearance_student_path = self.student_path + '/view_clearance' … … 146 144 self.assertEqual(self.browser.headers['Status'], '200 Ok') 147 145 self.assertEqual(self.browser.url, self.add_student_path) 148 self.browser.getControl(name="form.student_id").value = 'A123456'149 146 self.browser.getControl(name="form.name").value = 'Bob Tester' 150 147 self.browser.getControl("Create student record").click() 151 148 self.assertTrue('Student record created' in self.browser.contents) 152 self.browser.open(self.manage_container_path)153 self.browser.getLink("Add student").click()154 self.browser.getControl(name="form.student_id").value = 'A123456'155 self.browser.getControl(name="form.name").value = 'Bob Brother'156 self.browser.getControl("Create student record").click()157 self.assertTrue('The student id chosen already exists' in self.browser.contents)158 149 159 150 self.browser.open(self.container_path) … … 161 152 self.assertTrue('Empty search string' in self.browser.contents) 162 153 self.browser.getControl(name="searchtype").value = ['student_id'] 163 self.browser.getControl(name="searchterm").value = 'A123456' 164 self.browser.getControl("Search").click() 165 self.assertTrue('Bob Tester' in self.browser.contents) 166 # The old searchterm will be used again 167 self.browser.getControl("Search").click() 168 self.assertTrue('Bob Tester' in self.browser.contents) 154 self.browser.getControl(name="searchterm").value = self.test_student_id 155 self.browser.getControl("Search").click() 156 self.assertTrue('Anna Tester' in self.browser.contents) 169 157 170 158 self.browser.open(self.manage_container_path) … … 172 160 self.assertTrue('Empty search string' in self.browser.contents) 173 161 self.browser.getControl(name="searchtype").value = ['name'] 174 self.browser.getControl(name="searchterm").value = 'Bob Tester' 175 self.browser.getControl("Search").click() 176 self.assertTrue('A123456' in self.browser.contents) 162 self.browser.getControl(name="searchterm").value = 'Anna Tester' 163 self.browser.getControl("Search").click() 164 self.assertTrue('Anna Tester' in self.browser.contents) 165 # The old searchterm will be used again 166 self.browser.getControl("Search").click() 167 self.assertTrue('Anna Tester' in self.browser.contents) 168 177 169 ctrl = self.browser.getControl(name='entries') 178 ctrl.getControl(value= 'A123456').selected = True170 ctrl.getControl(value=self.test_student_id).selected = True 179 171 self.browser.getControl("Remove selected", index=0).click() 180 172 self.assertTrue('Successfully removed' in self.browser.contents) 181 173 self.browser.getControl(name="searchtype").value = ['student_id'] 182 self.browser.getControl(name="searchterm").value = 'A123456'174 self.browser.getControl(name="searchterm").value = self.test_student_id 183 175 self.browser.getControl("Search").click() 184 176 self.assertTrue('No student found' in self.browser.contents) … … 186 178 self.browser.open(self.container_path) 187 179 self.browser.getControl(name="searchtype").value = ['student_id'] 188 self.browser.getControl(name="searchterm").value = 'A123456'180 self.browser.getControl(name="searchterm").value = self.test_student_id 189 181 self.browser.getControl("Search").click() 190 182 self.assertTrue('No student found' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.