Changeset 6423 for main/waeup.sirp/trunk/src
- Timestamp:
- 20 Jun 2011, 15:19:43 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/accesscodes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py
r6420 r6423 9 9 IWorkflowInfo, InvalidTransitionError, IWorkflowState) 10 10 from random import SystemRandom as random 11 from waeup.sirp.interfaces import IWAeUPSIRPPluggable 11 from waeup.sirp.interfaces import IWAeUPSIRPPluggable, IObjectHistory 12 12 from waeup.sirp.accesscodes.interfaces import ( 13 13 IAccessCode, IAccessCodeBatch, IAccessCodeBatchContainer … … 60 60 def used(self): 61 61 return IWorkflowState(self).getState() == USED 62 63 @property 64 def history(self): 65 history = IObjectHistory(self) 66 return '\n'.join(history.messages) 62 67 63 68 class AccessCodeBatch(grok.Container): -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/interfaces.py
r6419 r6423 37 37 title = u'Complete title of access code', 38 38 ) 39 history = schema.Text( 40 title = u'The history of access code as lines', 41 default = u'', 42 readonly = True, 43 ) 39 44 40 45 class IAccessCodeBatch(Interface): -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py
r6422 r6423 211 211 self.app = self.getRootFolder()['app'] 212 212 213 # Create batch 214 batch = AccessCodeBatch('now', 'manfred', 'APP', 6.6, 0) 215 self.app['accesscodes'].addBatch(batch) 216 217 # Fill batch with accesscodes 218 batch.addAccessCode(0, '11111111') 219 220 self.ac1 = batch.getAccessCode('APP-1-11111111') 213 221 setSite(self.app) 214 222 return … … 220 228 221 229 def test_iface(self): 230 # AccessCodes fullfill their iface promises. 222 231 ac = AccessCode('1', '12345678') 223 232 assert verifyObject(IAccessCode, ac) 224 233 assert verifyClass(IAccessCode, AccessCode) 234 235 def test_history(self): 236 # Access codes have a history. 237 match = re.match( 238 '^../../.... ..:..:.. - Initialized \(new state: initialized\)', 239 self.ac1.history) 240 assert match is not None 225 241 226 242 class AccessCodeBatchTests(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.