

def testFlagAnon(self):
    'GET/POST the flag view while not logged in: redirect to log in.'
    comments = self.createSomeComments()
    pk = comments[0].pk
    response = self.client.get(('/flag/%d/' % pk))
    self.assertEqual(response['Location'], ('http://testserver/accounts/login/?next=/flag/%d/' % pk))
    response = self.client.post(('/flag/%d/' % pk))
    self.assertEqual(response['Location'], ('http://testserver/accounts/login/?next=/flag/%d/' % pk))

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