Changeset 9290 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 4 Oct 2012, 12:07:53 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py
r9261 r9290 165 165 return False 166 166 167 def trigger_export(self): 168 # helper to start an export. Make sure to remove the result file 169 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 170 self.browser.open(self.datacenter_path) 171 self.browser.getLink("Export data").click() 172 self.browser.getControl(name="exporter").value = ['faculties'] 173 self.browser.getControl("Create CSV file").click() 174 return 175 176 def cleanup_run_job(self): 177 # helper to remove any result file of an export 178 job_id = self.wait_for_export_job_completed() 179 manager = getUtility(IJobManager) 180 job = manager.get(job_id) 181 if os.path.exists(job.result): 182 shutil.rmtree(os.path.dirname(job.result)) 183 167 184 def test_export_start(self): 168 185 # we can trigger export file creation … … 175 192 self.browser.getControl("Create CSV file").click() 176 193 self.assertEqual(self.browser.headers['Status'], '200 Ok') 194 self.cleanup_run_job() # make sure to remove temp dirs 177 195 return 178 196 179 197 def test_export_download(self): 180 198 # we can download a generated export result 181 self.t est_export_start()199 self.trigger_export() 182 200 # while the export file is created, we get a reload button 183 201 # (or a loading bar if javascript is enabled)... … … 264 282 '<option value="accesscodebatches">' in self.browser.contents) 265 283 # ... but not the accesscodes exporter. 266 self.assertFalse('<option value="accesscodes">' in self.browser.contents) 284 self.assertFalse('<option value="accesscodes">' 285 in self.browser.contents) 267 286 268 287 def test_export_discard(self): 269 288 # we can discard a generated export result 270 self.t est_export_start()289 self.trigger_export() 271 290 self.wait_for_export_job_completed() 272 291 self.browser.open(self.datacenter_path + '/@@export') … … 294 313 295 314 def test_set_former_course(self): 296 # A certificate course will be automatically removed when 297 # theformer_course attribute of the corresponding course is set.315 # A certificate course will be automatically removed when the 316 # former_course attribute of the corresponding course is set. 298 317 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 299 318 self.assertTrue(self.app['faculties']['fac1']['dep1'].certificates[ 300 319 'CERT1'].has_key('COURSE1_100')) 301 self.browser.open('http://localhost/app/faculties/fac1/dep1/courses/COURSE1/manage') 320 self.browser.open( 321 'http://localhost/app/faculties/fac1/dep1/courses/COURSE1/manage') 302 322 self.browser.getControl(name="form.former_course").value = ['selected'] 303 323 self.browser.getControl("Save").click()
Note: See TracChangeset for help on using the changeset viewer.