'Deleting a revision while logged out redirects to login.'

def test_delete_revision_logged_out(self):

    doc = DocumentFactory()
    rev = RevisionFactory(document=doc)
    response = get(self.client, 'wiki.delete_revision', args=[doc.slug, rev.id])
    redirect = response.redirect_chain[0]
    eq_(302, redirect[1])
    eq_(('http://testserver/%s%s?next=/en-US/kb/%s/revision/%s/delete' % (settings.LANGUAGE_CODE, settings.LOGIN_URL, doc.slug, rev.id)), redirect[0])
    response = post(self.client, 'wiki.delete_revision', args=[doc.slug, rev.id])
    redirect = response.redirect_chain[0]
    eq_(302, redirect[1])
    eq_(('http://testserver/%s%s?next=/en-US/kb/%s/revision/%s/delete' % (settings.LANGUAGE_CODE, settings.LOGIN_URL, doc.slug, rev.id)), redirect[0])
