- Timestamp:
- 20 Sep 2012, 08:49:37 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-zc-async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-zc-async
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/tests/test_objecthistory.py
r8234 r9209 91 91 self.assertMatches('<YYYY-MM-DD hh:mm:ss> UTC - blah by Bob', result) 92 92 93 def test_modify_messages(self): 94 principal = Principal('bob') 95 principal.title = 'Bob' 96 newInteraction(Participation(principal)) # set current user 97 hist = IObjectHistory(self.obj) 98 hist.addMessage('blah') 99 hist.modifyMessages('blah', 'blow') 100 result = ''.join(hist.messages) 101 self.assertMatches('<YYYY-MM-DD hh:mm:ss> UTC - blow by Bob', result) 102 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 success, text = hist.removeMessage('xyz') 115 self.assertFalse(success) 116 self.assertEqual(text, 'Not a number') 117 success, text = hist.removeMessage(100) 118 self.assertFalse(success) 119 self.assertEqual(text, 'Number out of range') 120 success, text = hist.removeMessage(1) 121 self.assertTrue(success) 122 self.assertMatches('<YYYY-MM-DD hh:mm:ss> UTC - blow by Bob', text) 123 self.assertEqual(len(hist.messages), 1) 124 result = ' '.join(hist.messages) 125 self.assertFalse('blow by Bob' in result) 126 93 127 def test_messages(self): 94 128 # we get messages as a persistent list of strings
Note: See TracChangeset for help on using the changeset viewer.