Ignore:
Timestamp:
30 Aug 2012, 07:26:27 (12 years ago)
Author:
Henrik Bettermann
Message:

Add removeMessage to ObjectHistory? class which removes a single history message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/tests/test_objecthistory.py

    r9012 r9125  
    101101        self.assertMatches('<YYYY-MM-DD hh:mm:ss> UTC - blow by Bob', result)
    102102
     103    def test_remove_message(self):
     104        principal = Principal('bob')
     105        principal.title = 'Bob'
     106        newInteraction(Participation(principal)) # set current user
     107        hist = IObjectHistory(self.obj)
     108        hist.addMessage('blah')
     109        hist.addMessage('blow')
     110        self.assertEqual(len(hist._getMessages()),2)
     111        result = ' '.join(hist.messages)
     112        self.assertTrue('blah by Bob' in result)
     113        self.assertTrue('blow by Bob' in result)
     114        hist.removeMessage(1)
     115        self.assertEqual(len(hist._getMessages()),1)
     116        result = ' '.join(hist.messages)
     117        self.assertFalse('blow by Bob' in result)
     118
    103119    def test_messages(self):
    104120        # we get messages as a persistent list of strings
Note: See TracChangeset for help on using the changeset viewer.