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