def test_actor(self): author = create_user() op = create_comment(author=author, reply_content=create_content()) replier = create_user() reply = create_comment(replied_comment=op, author=replier) activity = ThreadReplyActivity.from_comment(replier, reply) self.assertEqual(activity.actor['id'], replier.id)
def test_anonymous_actor(self): author = create_user() op = create_comment(author=author, reply_content=create_content()) for anon in [True, False]: replier = create_user() reply = create_comment(replied_comment=op, author=replier, anonymous=anon) activity = ThreadReplyActivity.from_comment(replier, reply) self.assertEqual(activity.is_actor_anonymous, anon)
def _action_thread_replied(self, notification): return ThreadReplyActivity.from_comment(notification.actor, notification.comment)