'Deleting an answer while logged out redirects to login.'

def test_delete_answer_logged_out(self):

    self.client.logout()
    q = self.question
    ans = q.last_answer
    response = get(self.client, 'questions.delete_answer', args=[self.question.id, ans.id])
    redirect = response.redirect_chain[0]
    eq_(302, redirect[1])
    eq_(('http://testserver/%s%s?next=/en-US/questions/%s/delete/%s' % (settings.LANGUAGE_CODE, settings.LOGIN_URL, q.id, ans.id)), redirect[0])
    response = post(self.client, 'questions.delete_answer', args=[self.question.id, ans.id])
    redirect = response.redirect_chain[0]
    eq_(302, redirect[1])
    eq_(('http://testserver/%s%s?next=/en-US/questions/%s/delete/%s' % (settings.LANGUAGE_CODE, settings.LOGIN_URL, q.id, ans.id)), redirect[0])
