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)))
评论列表
文章目录