Exemplo n.º 1
0
 def test_like_create(self):
     """
     create like
     """
     form_data = {}
     form = LikeForm(data=form_data)
     form.comment = self.comment
     form.user = self.user
     self.assertEqual(form.is_valid(), True)
Exemplo n.º 2
0
 def test_like_create(self):
     """
     create like
     """
     form_data = {}
     form = LikeForm(data=form_data)
     form.comment = self.comment
     form.user = self.user
     self.assertEqual(form.is_valid(), True)
Exemplo n.º 3
0
 def test_like_create_invalid(self):
     """
     create like twice
     """
     CommentLike.objects.create(user=self.user, comment=self.comment)
     form_data = {}
     form = LikeForm(data=form_data)
     form.comment = self.comment
     form.user = self.user
     self.assertEqual(form.is_valid(), False)
Exemplo n.º 4
0
 def test_like_create_invalid(self):
     """
     create like twice
     """
     CommentLike.objects.create(user=self.user, comment=self.comment)
     form_data = {}
     form = LikeForm(data=form_data)
     form.comment = self.comment
     form.user = self.user
     self.assertEqual(form.is_valid(), False)