コード例 #1
0
 def test_rep_for_question_comment_deleted(self):
     """Rep removed for a hard delete of a question comment."""
     comment = QuestionCommentFactory()
     comment.delete()
     self.assertEqual(
         comment.author.reputation,
         self.reputation_history(comment.author)[0]
     )
コード例 #2
0
 def test_rep_for_question_comment_unpublished(self):
     """Rep removed when published set to False on a question comment."""
     comment = QuestionCommentFactory()
     comment.published = False
     comment.save()
     self.assertEqual(
         comment.author.reputation,
         self.reputation_history(comment.author)[0]
     )
コード例 #3
0
 def test_rep_for_question_comment_unpublished(self):
     """Rep not added upon creation of a question comment with published=
     False, added when published set to True.
     """
     comment = QuestionCommentFactory(published=False)
     self.assertEqual(
         comment.author.reputation,
         self.reputation_history(comment.author)[0]
     )
     comment.published = True
     comment.save()
     self.assertEqual(
         comment.author.reputation,
         self.reputation_history(comment.author)[0] +
         config.TINE_REP_FOR_QUESTION_COMMENT
     )