'POSTing to ban_user_and_cleanup url with revisions to a document.'

def test_post_reverts_page(self):

    new_document = create_document(save=True)
    self.create_revisions(num=1, document=new_document, creator=self.admin)
    original_content = new_document.current_revision.content
    spam_revisions = self.create_revisions(num=3, document=new_document, creator=self.testuser)
    for rev in spam_revisions:
        rev.content = 'Spam!'
        rev.save()
    eq_(new_document.current_revision.id, spam_revisions[2].id)
    eq_(new_document.current_revision.creator, self.testuser)
    data = {'revision-id': [rev.id for rev in spam_revisions]}
    self.client.login(username='admin', password='testpass')
    resp = self.client.post(self.ban_testuser_url, data=data)
    eq_(200, resp.status_code)
    new_document = Document.objects.filter(id=new_document.id).first()
    for revision in spam_revisions:
        ok_((revision.id != new_document.current_revision.id))
    latest_revision = Revision.objects.order_by('-id').first()
    eq_(new_document.current_revision.id, latest_revision.id)
    eq_(new_document.current_revision.creator, self.admin)
    eq_(new_document.current_revision.content, original_content)
