Exemplo n.º 1
0
 def test_confirm_content_of_comment(self):
     testComment = "This is a lovely comment"
     comment = Comment(post=self.post,
                       user=self.u_profile,
                       comment=testComment)
     comment.save()
     self.assertEqual(testComment, comment.comment)
Exemplo n.º 2
0
 def test_confirm_comment_of_comment_exists(self):
     testComment = "This is a lovely comment"
     comment = Comment(post=self.post,
                       user=self.u_profile,
                       comment=testComment)
     comment.save()
     self.assertIsNotNone(comment.comment)
Exemplo n.º 3
0
def add_comment(u_profile, post, content):
    comment = Comment(user=u_profile, post=post, comment=content)
    comment.save()
    return comment
Exemplo n.º 4
0
 def test_confirm_post_of_comment(self):
     comment = Comment(post=self.post, user=self.u_profile)
     comment.save()
     self.assertEqual(self.post, comment.post)
Exemplo n.º 5
0
 def test_confirm_post_of_comment_exists(self):
     comment = Comment(post=self.post, user=self.u_profile)
     comment.save()
     self.assertIsNotNone(comment.post)
Exemplo n.º 6
0
 def test_ensure_correct_date_comment(self):
     comment = Comment(post=self.post, user=self.u_profile)
     comment.save()
     #get current date
     today = date.today()
     self.assertEqual((comment.date == today), True)
Exemplo n.º 7
0
 def test_ensure_report_is_positive(self):
     comment = Comment(post=self.post, user=self.u_profile)
     comment.save()
     self.assertEqual((comment.report >= 0), True)
Exemplo n.º 8
0
 def test_ensure_accuracyRating_is_positive(self):
     comment = Comment(post=self.post, user=self.u_profile)
     comment.save()
     self.assertEqual((comment.accuracyRating >= 0), True)
Exemplo n.º 9
0
 def test_ensure_burnfactor_is_positive(self):
     comment = Comment(post=self.post, user=self.u_profile, burnfactor=0)
     comment.save()
     self.assertEqual((comment.burnfactor >= 0), True)
Exemplo n.º 10
0
 def test_ensure_loveliness_is_positive(self):
     comment = Comment(post=self.post, user=self.u_profile)
     comment.save()
     self.assertEqual((comment.loveliness >= 0), True)
Exemplo n.º 11
0
 def test_ensure_id_increment_comment(self):
     first_comment = Comment(post=self.post, user=self.u_profile)
     first_comment.save()
     second_comment = Comment(post=self.post, user=self.u_profile)
     second_comment.save()
     self.assertIs(1, second_comment.id - first_comment.id)