Skip to content

Commit

Permalink
Fix get_audit_log test
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed May 6, 2016
1 parent 587cf97 commit 1b3effa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/collective/fingerpointing/tests/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ def test_audit_log_view_is_protected(self):
self.portal.restrictedTraverse('@@fingerpointing-audit-log')

def test_log_tail(self):
from logging import INFO
from Products.PlonePAS.events import UserLoggedOutEvent
from testfixtures import LogCapture
from zope.event import notify
# verify user logged out event is first on log (newer entries first)
event = UserLoggedOutEvent(self.request)
with LogCapture(level=INFO):
notify(event)
self.assertIn('action=logout', self.view.get_audit_log)
notify(event)
audit_log = self.view.get_audit_log.split('\n')
# user logged out event is first on log (newer entries first)
self.assertIn('user=test ip=127.0.0.1 action=logout', audit_log[0])

0 comments on commit 1b3effa

Please sign in to comment.