Changeset 7375 for main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Timestamp:
- 18 Dec 2011, 11:27:43 (13 years ago)
- 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 101 101 self.setup(site, name, logger) 102 102 return 103 104 def application_exists(identifier):105 """Check whether an application for the given identifier already106 exists.107 108 `identifier` will normally be an access code.109 """110 applicant = get_applicant_data(identifier)111 if applicant is None:112 return False113 return True -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_root.py
r7374 r7375 28 28 from waeup.sirp.app import University 29 29 from waeup.sirp.applicants import ( 30 interfaces, application_exists, get_applicant_data, Applicant, 31 ApplicantsContainer, 30 interfaces, Applicant, ApplicantsContainer, 32 31 ) 33 32 from waeup.sirp.applicants.root import ( … … 193 192 return 194 193 195 196 class HelperToolsTest(FunctionalTestCase):197 198 layer = FunctionalLayer199 200 def setUp(self):201 super(HelperToolsTest, self).setUp()202 203 # Setup a sample site for each test204 app = University()205 self.dc_root = tempfile.mkdtemp()206 app['datacenter'].setStoragePath(self.dc_root)207 208 # Prepopulate the ZODB...209 self.getRootFolder()['app'] = app210 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.container1216 self.container2 = ApplicantsContainer()217 self.app['applicants']['bar'] = self.container2218 self.ac = u'APP-99999'219 self.applicant = Applicant()220 #self.applicant.access_code = self.ac221 self.app['applicants']['foo'][self.ac] = self.applicant222 return223 224 def tearDown(self):225 super(HelperToolsTest, self).tearDown()226 shutil.rmtree(self.dc_root)227 return228 229 def test_application_exists(self):230 result = application_exists('APP-99999')231 assert result is True232 233 result = application_exists('APP-44444')234 assert result is False235 return236 237 194 def suite(): 238 195 suite = unittest.TestSuite() … … 240 197 ApplicantsRootTestCase, 241 198 ApplicantsRootPluginTestCase, 242 HelperToolsTest,243 199 ]: 244 200 suite.addTests(unittest.makeSuite(testcase))
Note: See TracChangeset for help on using the changeset viewer.