Ignore:
Timestamp:
7 Mar 2011, 02:27:39 (14 years ago)
Author:
uli
Message:

Fix tests to use correct folder names for applicant container and
jambdata container.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_util.py

    r5761 r5801  
    2525from zope.component.hooks import setSite
    2626from zope.site import LocalSiteManager
    27 from zope.site.folder import Folder
    28 from zope.site.testing import siteSetUp, siteTearDown
    29 from waeup.sirp.applicants.tests.test_authentication import (
    30     FakeSite)
    3127from waeup.sirp.applicants.jambtables.util import (
    3228    application_exists, get_applicant_data
    3329    )
     30from waeup.sirp.app import University
     31from waeup.sirp.applicants import Applicant
     32from waeup.sirp.applicants.container import ApplicantsContainer
     33from waeup.sirp.testing import WAeUPSIRPUnitTestLayer
     34
     35fake_apps = {
     36    'pude10' : ApplicantsContainer(),
     37    'pude11' : ApplicantsContainer(),
     38    }
     39
     40fake_apps['pude10']['APP-99999'] = Applicant()
     41
    3442
    3543class HelperToolsTest(unittest.TestCase):
    3644
     45    layer = WAeUPSIRPUnitTestLayer
     46   
    3747    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
    4255        self.app.setSiteManager(LocalSiteManager(self.app))
    4356        setSite(self.app)
     
    4558
    4659    def tearDown(self):
    47         siteTearDown()
    48         return
     60        pass
    4961
    5062    def test_application_exists(self):
     
    5466        result = application_exists('APP-44444')
    5567        assert result is True
    56        
    5768        return
     69
    5870
    5971def test_suite():
     
    6274        HelperToolsTest,
    6375        ]:
    64         suite.addTest(unittest.TestLoader().loadTestsFromTestCase(
    65                 testcase
    66                 )
    67         )
     76        suite.addTests(unittest.makeSuite(testcase))
    6877    return suite
Note: See TracChangeset for help on using the changeset viewer.