

def testCreateValidComment(self):
    a = Article.objects.get(pk=1)
    data = a.getValidData(a)
    self.response = self.client.post('/post/', data, REMOTE_ADDR='1.2.3.4')
    self.assertEqual(self.response.status_code, 302)
    self.assertEqual(Comment.objects.count(), 1)
    c = Comment.objects.all()[0]
    self.assertEqual(c.ip_address, '1.2.3.4')
    self.assertEqual(c.comment, 'This is my comment')

dataset/ETHPy150Open dcramer/django-compositepks/tests/regressiontests/comment_tests/tests/comment_view_tests.py CommentViewTests.testCreateValidComment/VarMisuse@25/29 `self`->`a`