Ignore:
Timestamp:
20 Jun 2011, 15:19:43 (13 years ago)
Author:
uli
Message:

Support accessing the history for an access code via the access code itself.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py

    r6422 r6423  
    211211        self.app = self.getRootFolder()['app']
    212212
     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')
    213221        setSite(self.app)
    214222        return
     
    220228
    221229    def test_iface(self):
     230        # AccessCodes fullfill their iface promises.
    222231        ac = AccessCode('1', '12345678')
    223232        assert verifyObject(IAccessCode, ac)
    224233        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
    225241
    226242class AccessCodeBatchTests(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.