Changeset 5808 for main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Timestamp:
- 7 Mar 2011, 13:07:53 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_root.py
r5766 r5808 26 26 import unittest 27 27 from StringIO import StringIO 28 from zope.component.hooks import setSite, clearSite 28 29 from zope.interface.verify import verifyClass, verifyObject 29 from waeup.sirp.applicants import interfaces 30 from zope.site import LocalSiteManager 31 from waeup.sirp.app import University 32 from waeup.sirp.applicants import ( 33 interfaces, application_exists, get_applicant_data, Applicant, 34 ApplicantsContainer, 35 ) 30 36 from waeup.sirp.applicants.root import ( 31 37 ApplicantsRoot, ApplicantsPlugin, 32 38 ) 39 from waeup.sirp.testing import WAeUPSIRPUnitTestLayer 40 33 41 34 42 class FakeSite(dict): … … 148 156 return 149 157 158 fake_apps = { 159 'pude10' : ApplicantsContainer(), 160 'pude11' : ApplicantsContainer(), 161 } 162 163 fake_apps['pude10']['APP-99999'] = Applicant() 164 165 class HelperToolsTest(unittest.TestCase): 166 167 layer = WAeUPSIRPUnitTestLayer 168 169 def setUp(self): 170 self.app = University() 171 # Insert some applicants... 172 for container, data in fake_apps.items(): 173 self.app['applicants'][container] = data 174 self.app.setSiteManager(LocalSiteManager(self.app)) 175 setSite(self.app) 176 return 177 178 def tearDown(self): 179 clearSite() 180 return 181 182 def test_application_exists(self): 183 result = application_exists('APP-99999') 184 assert result is False 185 186 result = application_exists('APP-44444') 187 assert result is True 188 return 189 190 150 191 def suite(): 151 192 suite = unittest.TestSuite() … … 153 194 ApplicantsRootTestCase, 154 195 ApplicantsRootPluginTestCase, 196 HelperToolsTest, 155 197 ]: 156 198 suite.addTests(unittest.TestLoader().loadTestsFromTestCase(testcase))
Note: See TracChangeset for help on using the changeset viewer.