Esempio n. 1
0
    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)
Esempio n. 2
0
 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)
Esempio n. 3
0
    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)
Esempio n. 4
0
 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)