- Timestamp:
- 7 Mar 2011, 02:27:39 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_util.py
r5761 r5801 25 25 from zope.component.hooks import setSite 26 26 from zope.site import LocalSiteManager 27 from zope.site.folder import Folder28 from zope.site.testing import siteSetUp, siteTearDown29 from waeup.sirp.applicants.tests.test_authentication import (30 FakeSite)31 27 from waeup.sirp.applicants.jambtables.util import ( 32 28 application_exists, get_applicant_data 33 29 ) 30 from waeup.sirp.app import University 31 from waeup.sirp.applicants import Applicant 32 from waeup.sirp.applicants.container import ApplicantsContainer 33 from waeup.sirp.testing import WAeUPSIRPUnitTestLayer 34 35 fake_apps = { 36 'pude10' : ApplicantsContainer(), 37 'pude11' : ApplicantsContainer(), 38 } 39 40 fake_apps['pude10']['APP-99999'] = Applicant() 41 34 42 35 43 class HelperToolsTest(unittest.TestCase): 36 44 45 layer = WAeUPSIRPUnitTestLayer 46 37 47 def setUp(self): 38 self.root = Folder() 39 siteSetUp(self.root) 40 self.app = FakeSite() #grok.Application() 41 self.root['app'] = self.app 48 self.app = University() 49 # Fill up some JAMB data... 50 self.app['jambdata']['91100546DD'] = Applicant() 51 self.app['jambdata']['91100546DE'] = Applicant() 52 # Insert some applicants... 53 for container, data in fake_apps.items(): 54 self.app['applicants'][container] = data 42 55 self.app.setSiteManager(LocalSiteManager(self.app)) 43 56 setSite(self.app) … … 45 58 46 59 def tearDown(self): 47 siteTearDown() 48 return 60 pass 49 61 50 62 def test_application_exists(self): … … 54 66 result = application_exists('APP-44444') 55 67 assert result is True 56 57 68 return 69 58 70 59 71 def test_suite(): … … 62 74 HelperToolsTest, 63 75 ]: 64 suite.addTest(unittest.TestLoader().loadTestsFromTestCase( 65 testcase 66 ) 67 ) 76 suite.addTests(unittest.makeSuite(testcase)) 68 77 return suite
Note: See TracChangeset for help on using the changeset viewer.