Ignore:
Timestamp:
22 Dec 2011, 06:39:15 (13 years ago)
Author:
Henrik Bettermann
Message:

Move the test methods into the correct classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py

    r7430 r7432  
    284284        return
    285285
     286class 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
    286316    def test_add_delete_applicants(self):
    287317        # Managers can add and delete applicants
     
    314344        return
    315345
     346class ApplicantUITests(ApplicantsFullSetup):
     347    # Tests for uploading/browsing the passport image of appplicants
     348
     349    layer = FunctionalLayer
     350
    316351    def test_manage_and_view_applicant(self):
    317352        # Managers can manage applicants
     
    381416        self.assertMatches('...Form has been saved...', self.browser.contents)
    382417        return
    383 
    384 class ApplicantsContainerUITests(ApplicantsFullSetup):
    385     # Tests for ApplicantsContainer class views and pages
    386 
    387     layer = FunctionalLayer
    388 
    389     def test_anonymous_access(self):
    390         # Anonymous users can access applicants containers
    391         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         return
    396 
    397     def test_manage_access(self):
    398         # Managers can access the manage pages of applicants
    399         # containers and can perform actions
    400         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         return
    413 
    414 class ApplicantsPassportTests(ApplicantsFullSetup):
    415     # Tests for uploading/browsing the passport image of appplicants
    416 
    417     layer = FunctionalLayer
    418418
    419419    def image_url(self, filename):
Note: See TracChangeset for help on using the changeset viewer.