Changeset 7432 for main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests
- Timestamp:
- 22 Dec 2011, 06:39:15 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py
r7430 r7432 284 284 return 285 285 286 class ApplicantsContainerUITests(ApplicantsFullSetup): 287 # Tests for ApplicantsContainer class views and pages 288 289 layer = FunctionalLayer 290 291 def test_anonymous_access(self): 292 # Anonymous users can access applicants containers 293 self.browser.open(self.container_path) 294 self.assertEqual(self.browser.headers['Status'], '200 Ok') 295 self.assertFalse( 296 'Manage' in self.browser.contents) 297 return 298 299 def test_manage_access(self): 300 # Managers can access the manage pages of applicants 301 # containers and can perform actions 302 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 303 self.browser.open(self.manage_container_path) 304 self.assertEqual(self.browser.headers['Status'], '200 Ok') 305 self.assertEqual(self.browser.url, self.manage_container_path) 306 self.browser.getControl("Save").click() 307 self.assertTrue('Data saved' in self.browser.contents) 308 self.browser.getControl("Remove selected", index=0).click() 309 self.assertTrue('No applicant selected' in self.browser.contents) 310 self.browser.getControl("Add local role").click() 311 self.assertTrue('No user selected' in self.browser.contents) 312 self.browser.getControl("Cancel", index=0).click() 313 self.assertEqual(self.browser.url, self.container_path) 314 return 315 286 316 def test_add_delete_applicants(self): 287 317 # Managers can add and delete applicants … … 314 344 return 315 345 346 class ApplicantUITests(ApplicantsFullSetup): 347 # Tests for uploading/browsing the passport image of appplicants 348 349 layer = FunctionalLayer 350 316 351 def test_manage_and_view_applicant(self): 317 352 # Managers can manage applicants … … 381 416 self.assertMatches('...Form has been saved...', self.browser.contents) 382 417 return 383 384 class ApplicantsContainerUITests(ApplicantsFullSetup):385 # Tests for ApplicantsContainer class views and pages386 387 layer = FunctionalLayer388 389 def test_anonymous_access(self):390 # Anonymous users can access applicants containers391 self.browser.open(self.container_path)392 self.assertEqual(self.browser.headers['Status'], '200 Ok')393 self.assertFalse(394 'Manage' in self.browser.contents)395 return396 397 def test_manage_access(self):398 # Managers can access the manage pages of applicants399 # containers and can perform actions400 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')401 self.browser.open(self.manage_container_path)402 self.assertEqual(self.browser.headers['Status'], '200 Ok')403 self.assertEqual(self.browser.url, self.manage_container_path)404 self.browser.getControl("Save").click()405 self.assertTrue('Data saved' in self.browser.contents)406 self.browser.getControl("Remove selected", index=0).click()407 self.assertTrue('No applicant selected' in self.browser.contents)408 self.browser.getControl("Add local role").click()409 self.assertTrue('No user selected' in self.browser.contents)410 self.browser.getControl("Cancel", index=0).click()411 self.assertEqual(self.browser.url, self.container_path)412 return413 414 class ApplicantsPassportTests(ApplicantsFullSetup):415 # Tests for uploading/browsing the passport image of appplicants416 417 layer = FunctionalLayer418 418 419 419 def image_url(self, filename):
Note: See TracChangeset for help on using the changeset viewer.