Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)