+class AnonymousUser(object):
+ """Fake user object, for when the user isn't actually logged in.
+
+ Tests as false and tries to respond to method calls the expected way.
+ """
+
+ def __nonzero__(self):
+ return False
+ def __bool__(self):
+ return False
+
+ def can(self, action):
+ # XXX if viewing is ever a permission, this should probably change.
+ return False
+
+