Changeset 6590 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 10 Aug 2011, 22:03:44 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py
r6586 r6590 109 109 app['applicants']['app2009'][self.pin_applicant] = self.applicant 110 110 111 # Add an officer112 myusers = self.app['users']113 myusers.addUser('bob', 'bobssecret')114 return115 116 111 def tearDown(self): 117 112 super(ApplicantsFullSetup, self).tearDown() … … 156 151 self.assertEqual(self.browser.headers['Status'], '200 Ok') 157 152 self.assertEqual(self.browser.url, self.manage_root_path) 153 self.browser.getControl("Add local role").click() 154 self.assertTrue( 155 'No user selected' in self.browser.contents) 158 156 self.browser.open(self.manage_container_path) 159 157 self.assertEqual(self.browser.headers['Status'], '200 Ok') … … 165 163 self.assertTrue( 166 164 'No applicant selected' in self.browser.contents) 165 self.browser.getControl("Add local role").click() 166 self.assertTrue( 167 'No user selected' in self.browser.contents) 167 168 self.browser.getControl("Cancel", index=0).click() 168 169 self.assertEqual(self.browser.url, self.container_path) 170 # Managers can can assign local roles 171 myusers = self.app['users'] 172 myusers.addUser('bob', 'bobssecret') 173 self.browser.open(self.manage_root_path) 174 self.browser.getControl(name="user").value = ['bob'] 175 self.browser.getControl(name="local_role").value = ['waeup.ApplicationsOfficer'] 176 self.browser.getControl("Add local role").click() 177 self.assertTrue( 178 '<td>bob</td>' in self.browser.contents) 179 ctrl = self.browser.getControl(name='role_id') 180 ctrl.getControl(value='bob|waeup.ApplicationsOfficer').selected = True 181 self.browser.getControl("Remove selected local roles").click() 182 self.assertTrue('Successfully removed:' in self.browser.contents) 183 self.assertFalse( 184 '<td>bob</td>' in self.browser.contents) 185 self.browser.open(self.manage_container_path) 186 self.browser.getControl(name="user").value = ['bob'] 187 self.browser.getControl(name="local_role").value = ['waeup.ApplicationsOfficer'] 188 self.browser.getControl("Add local role").click() 189 self.assertTrue( 190 '<td>bob</td>' in self.browser.contents) 191 ctrl = self.browser.getControl(name='role_id') 192 ctrl.getControl(value='bob|waeup.ApplicationsOfficer').selected = True 193 self.browser.getControl("Remove selected local roles").click() 194 self.assertTrue('Successfully removed:' in self.browser.contents) 195 self.assertFalse( 196 '<td>bob</td>' in self.browser.contents) 169 197 return 170 198
Note: See TracChangeset for help on using the changeset viewer.