def test_serialize_comment(self):
        comment = 'comment'

        review_ui = self.file_attachment3.review_ui
        request = self.factory.get('test')
        request.user = self.user
        review_ui.request = request

        review = Review.objects.create(review_request=self.review_request,
                                       user=self.user, public=True)
        file_attachment_comment = review.file_attachment_comments.create(
            file_attachment=self.file_attachment3,
            text=comment)

        self.spy_on(review_ui.serialize_comment)

        serial_comments = review_ui.serialize_comments(
            comments=[file_attachment_comment])
        self.assertEqual(len(serial_comments), 0)

        self.assertTrue(review_ui.serialize_comment.called)
Testing FileAttachmentReviewUI sandboxes serialize_comment
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/reviews/ui/tests.py/SandboxTests.test_serialize_comment