Esempio n. 1
0
 def test_comment_form_returns_400_when_missing_data(self):
     """
     Assert 400 status code response when expected data is missing from
     the comment form. This simulates typical malicious bot behavior.
     """
     request = self._request_factory.post(reverse('comment'))
     response = comment(request)
     self.assertEquals(response.status_code, 400)
Esempio n. 2
0
 def test_comment_form_returns_400_when_missing_data(self):
     """
     Assert 400 status code response when expected data is missing from
     the comment form. This simulates typical malicious bot behavior.
     """
     request = self._request_factory.post(reverse('comment'))
     if settings.COMMENTS_ACCOUNT_REQUIRED:
         request.user = self._user
         request.session = {}
     response = comment(request)
     self.assertEquals(response.status_code, 400)
Esempio n. 3
0
 def test_comment_form_returns_400_when_missing_data(self):
     """
     Assert 400 status code response when expected data is missing from
     the comment form. This simulates typical malicious bot behavior.
     """
     request = self._request_factory.post(reverse('comment'))
     if settings.COMMENTS_ACCOUNT_REQUIRED:
         request.user = self._user
         request.session = {}
     response = comment(request)
     self.assertEquals(response.status_code, 400)