

def testDeletePermissions(self):
    "The delete view should only be accessible to 'moderators'"
    comments = self.createSomeComments()
    pk = comments[0].pk
    self.client.login(username='normaluser', password='normaluser')
    response = self.client.get(('/delete/%d/' % pk))
    self.assertEqual(response['Location'], ('http://testserver/accounts/login/?next=/delete/%d/' % pk))
    makeModerator('normaluser')
    response = self.client.get(('/delete/%d/' % pk))
    self.assertEqual(response.status_code, 200)

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