def test_hide(self): self.assertFalse(self.comment.is_removed) req = make_post_request(user=self.user, params=_comment_ids_to_params(self.comment.id)) hide(req, self.instance) updated_comment = EnhancedThreadedComment.objects.get( pk=self.comment.id) self.assertTrue(updated_comment.is_removed)
def test_batch_hide(self): self.assertFalse(self.comment.is_removed) self.assertFalse(self.comment2.is_removed) params = _comment_ids_to_params(self.comment.id, self.comment2.id) req = make_request(params, user=self.user, method='POST') hide(req, self.instance) updated_comments = EnhancedThreadedComment.objects.all() for updated_comment in updated_comments: self.assertTrue(updated_comment.is_removed)