Пример #1
0
    def test_get_comments_view(self):

        number_of_comments = DocumentComment.objects.count()  # (from the canopy)

        response = self.client.get("/api/v2/comments/")
        self.assertEqual(number_of_comments, response.data["count"])

        # moooore comments.
        DocumentCommentFactory.create_batch(50)

        response = self.client.get("/api/v2/comments/")
        self.assertEqual(number_of_comments + 50, response.data["count"])