示例#1
0
文件: tests.py 项目: StetHD/canvas-2
    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)
示例#2
0
    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)
示例#3
0
文件: tests.py 项目: StetHD/canvas-2
    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)
示例#4
0
    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)