def testGetPrincipalTransactions(self): request = self.request bonobo = principalRegistry.getPrincipal('bonobo') request.setPrincipal(bonobo) view = UndoView(self.folder1, request) expected = self.undo.getPrincipalTransactions(bonobo) self.assertEqual(view.getPrincipalTransactions(), expected) self.assert_(self.undo.context is self.folder1) self.assert_(self.undo.principal is bonobo) # test showall parameter and principal self.undo.principal = None view.getPrincipalTransactions(showall=True) self.assert_(self.undo.context is None) self.assert_(self.undo.principal is bonobo)