Ignore:
Timestamp:
18 Dec 2011, 11:27:43 (13 years ago)
Author:
Henrik Bettermann
Message:

Also application_exists is outdated and no longer used.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py

    r7374 r7375  
    101101        self.setup(site, name, logger)
    102102        return
    103 
    104 def application_exists(identifier):
    105     """Check whether an application for the given identifier already
    106        exists.
    107 
    108        `identifier` will normally be an access code.
    109     """
    110     applicant = get_applicant_data(identifier)
    111     if applicant is None:
    112         return False
    113     return True
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_root.py

    r7374 r7375  
    2828from waeup.sirp.app import University
    2929from waeup.sirp.applicants import (
    30     interfaces, application_exists, get_applicant_data, Applicant,
    31     ApplicantsContainer,
     30    interfaces, Applicant, ApplicantsContainer,
    3231    )
    3332from waeup.sirp.applicants.root import (
     
    193192        return
    194193
    195 
    196 class HelperToolsTest(FunctionalTestCase):
    197 
    198     layer = FunctionalLayer
    199 
    200     def setUp(self):
    201         super(HelperToolsTest, self).setUp()
    202 
    203         # Setup a sample site for each test
    204         app = University()
    205         self.dc_root = tempfile.mkdtemp()
    206         app['datacenter'].setStoragePath(self.dc_root)
    207 
    208         # Prepopulate the ZODB...
    209         self.getRootFolder()['app'] = app
    210         self.app = self.getRootFolder()['app']
    211         setSite(self.app)
    212 
    213         # Insert some applicants containers and applicants...
    214         self.container1 = ApplicantsContainer()
    215         self.app['applicants']['foo'] = self.container1
    216         self.container2 = ApplicantsContainer()
    217         self.app['applicants']['bar'] = self.container2
    218         self.ac = u'APP-99999'
    219         self.applicant = Applicant()
    220         #self.applicant.access_code = self.ac
    221         self.app['applicants']['foo'][self.ac] = self.applicant
    222         return
    223 
    224     def tearDown(self):
    225         super(HelperToolsTest, self).tearDown()
    226         shutil.rmtree(self.dc_root)
    227         return
    228 
    229     def test_application_exists(self):
    230         result = application_exists('APP-99999')
    231         assert result is True
    232 
    233         result = application_exists('APP-44444')
    234         assert result is False
    235         return
    236 
    237194def suite():
    238195    suite = unittest.TestSuite()
     
    240197            ApplicantsRootTestCase,
    241198            ApplicantsRootPluginTestCase,
    242             HelperToolsTest,
    243199            ]:
    244200        suite.addTests(unittest.makeSuite(testcase))
Note: See TracChangeset for help on using the changeset viewer.