

def testDeletePost(self):
    'POSTing the delete view should mark the comment as removed'
    comments = self.createSomeComments()
    pk = comments[0].pk
    makeModerator('normaluser')
    self.client.login(username='normaluser', password='normaluser')
    response = self.client.post(('/delete/%d/' % pk))
    self.assertEqual(response['Location'], ('http://testserver/deleted/?c=%d' % pk))
    c = Comment.objects.get(pk=pk)
    self.assertTrue(c.is_removed)
    self.assertEqual(c.flags.filter(flag=CommentFlag.MODERATOR_DELETION, user__username='normaluser').count(), 1)

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/comment_tests/tests/moderation_view_tests.py DeleteViewTests.testDeletePost/original