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