def testPreventDuplicateComments(self):
        a = Article.objects.get(pk=1)
        data = self.getValidData(a)
        self.client.post("/post/", data)
        self.client.post("/post/", data)
        self.assertEqual(Comment.objects.count(), 1)

        # This should not trigger the duplicate prevention
        self.client.post("/post/", dict(data, comment="My second comment."))
        self.assertEqual(Comment.objects.count(), 2)
Prevent posting the exact same comment twice
dataset/ETHPy150Open dcramer/django-compositepks/tests/regressiontests/comment_tests/tests/comment_view_tests.py/CommentViewTests.testPreventDuplicateComments