Changeset 6422 for main/waeup.sirp/trunk


Ignore:
Timestamp:
20 Jun 2011, 14:59:56 (14 years ago)
Author:
uli
Message:

Check the comment feature in tests.

File:
1 edited

Legend:

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

    r6417 r6422  
    3535from zope.testing import renormalizing
    3636from waeup.sirp.app import University
     37from waeup.sirp.interfaces import IObjectHistory
    3738from waeup.sirp.testing import FunctionalLayer
    3839from waeup.sirp.accesscodes.accesscodes import (
     
    179180            fire_transition, 'APP-1-11111111', 'init') # already initialized
    180181
     182    def test_fire_transition_comment(self):
     183        # when we request a comment, it will also appear in history
     184        fire_transition('APP-1-11111111', 'use', comment='Hi there!')
     185        history = IObjectHistory(self.ac1)
     186        msgs = history.messages
     187        assert 'Hi there!' in msgs[-1]
     188
     189    def test_fire_transition_no_comment(self):
     190        # without comment, the history should be without trailing garbage
     191        fire_transition('APP-1-11111111', 'use')
     192        history = IObjectHistory(self.ac1)
     193        msgs = history.messages
     194        assert msgs[-1].endswith(' - Used (new state: used)')
    181195
    182196class AccessCodeTests(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.