Changeset 12596 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 11 Feb 2015, 15:34:12 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_async.py
r12595 r12596 10 10 from waeup.kofa.app import University 11 11 from waeup.kofa.async import AsyncJob, get_job_id 12 from waeup.kofa.interfaces import IJobManager, IKofaUtils 13 from waeup.kofa.testing import ( 14 FunctionalTestCase, FunctionalLayer, expensive_actions, 15 ) 12 from waeup.kofa.interfaces import IJobManager 13 from waeup.kofa.testing import FunctionalLayer, expensive_actions 16 14 from waeup.kofa.tests.test_async import FunctionalAsyncTestCase 17 15 18 16 19 17 def fake_get_export_jobs_status(user_id=None): 20 return [('completed', 'Completed', 'my_exporter'), ]18 return [('completed', 'Completed', 'my_exporter'), ] 21 19 22 20 … … 54 52 shutil.rmtree(self.workdir) 55 53 54 56 55 class JobViewTests(AsyncBrowserTests): 57 56 # Tests for the view of single jobs … … 85 84 def test_anonymous_forbidden(self): 86 85 # we need some permissions to get a job view 87 transaction.commit() # make sure the 'app' is stored in ZODB86 transaction.commit() # make sure the 'app' is stored in ZODB 88 87 job = self.start_job() 89 88 wait_for_result(job) … … 117 116 manager = getUtility(IJobManager) 118 117 job = AsyncJob(dummy_func) 119 site = self.getRootFolder()120 118 with expensive_actions() as utils: 121 utils.expensive_actions_allowed = lambda 119 utils.expensive_actions_allowed = lambda: False 122 120 result = manager.put(job, site=self.getRootFolder()) 123 121 self.assertTrue(result is None) … … 132 130 def test_anonymous_forbidden(self): 133 131 # anonymous user will be kept out 134 browser = Browser() # get a browser w/o credentials set132 browser = Browser() # get a browser w/o credentials set 135 133 browser.handleErrors = False 136 134 self.assertRaises(Unauthorized, browser.open, self.overview_path) … … 168 166 return 169 167 168 170 169 class DataCenterJSONTests(AsyncBrowserTests): 171 170
Note: See TracChangeset for help on using the changeset viewer.