コード例 #1
0
ファイル: tests.py プロジェクト: JoshIUSBStudent/otm-core
    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)
コード例 #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)
コード例 #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)
コード例 #4
0
ファイル: tests.py プロジェクト: OpenTreeMap/otm-core
 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)