conversation_tests.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:mltshp 作者: MLTSHP 项目源码 文件源码
def test_for_user_doesnt_return_muted_conversations(self):
        """
        When we create a Comment, conversation gets created for the sharedfile owner and the
        commenter.  The conversation should appear for the commenter, unless the conversation
        gets muted, in which case it doesn't get returned.
        """
        comment = Comment(sharedfile_id=self.sharedfile.id, user_id=self.another_user.id, body='test')
        comment.save()

        another_user_conversation = Conversation.get('user_id = %s', self.another_user.id)
        self.assertEqual(0, another_user_conversation.muted)
        self.assertEqual(1, len(Conversation.for_user(self.another_user.id)))

        another_user_conversation.muted = 1
        another_user_conversation.save()
        self.assertEqual(0, len(Conversation.for_user(self.another_user.id)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号